Skip to content

Instantly share code, notes, and snippets.

@davidcann
Created June 1, 2009 20:20
Show Gist options
  • Save davidcann/121720 to your computer and use it in GitHub Desktop.
Save davidcann/121720 to your computer and use it in GitHub Desktop.
/*
* DCLinkTextField.j
*
* Created by David Cann on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation DCLinkTextField : CPTextField {
CPColor _oldTextColor;
CPString HTML @accessors;
id HTMLElement @accessors;
}
- (id)initWithFrame:(CGRect)aFrame {
self = [super initWithFrame:aFrame];
if (self) {
var contentView = [self layoutEphemeralSubviewNamed:@"content-view"
positioned:CPWindowAbove
relativeToEphemeralSubviewNamed:@"bezel-view"];
HTMLElement = document.createElement("div");
HTMLElement.style.width = "100%";
HTMLElement.style.height = "100%";
contentView._DOMElement.appendChild(HTMLElement);
}
return self;
}
- (void)setHTML:(CPString)theHTML {
HTMLElement.innerHTML = theHTML;
}
- (void)HTML {
return HTMLElement.innerHTML;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment