Created
June 1, 2009 20:20
-
-
Save davidcann/121720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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