Skip to content

Instantly share code, notes, and snippets.

@Me1000
Created August 9, 2010 00:56
Show Gist options
  • Save Me1000/514766 to your computer and use it in GitHub Desktop.
Save Me1000/514766 to your computer and use it in GitHub Desktop.
// for example purposes
@implementation RLHTMLView : CPView
{
DOMElement HTMLDOMElement;
}
- (id)initWithFrame:(CGRect)aRect
{
self = [super initWithFrame:aRect];
if (self)
{
// since we're talking to the DOM we use straight up javascript
HTMLDOMElement = document.createElement("div");
// and we need to set some properties
HTMLDOMElement.style.width = "100%";
HTMLDOMElement.style.height = "100%";
// customize it more if you need to... overflow properties perhaps?
// _DOMElement is a private ivar of CPView
_DOMElement.appendChild(HTMLDOMElement);
}
return self;
}
- (void)setObjectValue:(id)aValue
{
HTMLDOMElement.innerHTML = aValue;
}
- (id)objectValue
{
return HTMLDOMElement.innerHTML;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment