Re: [Pyobjc-dev] Displaying HTML in NSTextView
Brought to you by:
ronaldoussoren
From: Dinu G. <gh...@da...> - 2003-07-03 15:38:49
|
I wondered: > did anybody succeed already in displaying HTML code properly > inside NSTextViews? If so, I'd be grateful for a simple code > snippet... The ObjC stuff I've found so far does successfully > resist my Pythonification attempts... Strange... There seems to be a method for NSAttributedString with the following ObjC-signature: - (id)initWithHTML:(NSData *)data baseURL:(NSURL *)aURL documentAttributes:(NSDictionary **)docAttributes It was really hard to find on this page: http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSAttributedString.html but it seems not to be described in my local Developer header files! Neither is it described in my copy of CocoaBrowser.app (which just imports the local developer documentation, I think). Using it in ObjC works, but since much of the PyObjC-interface was somehow created automatically from such header files I guess, it is just not available in PyObjC now! I'm not sure if this method is deprecated or what. It makes sense and it works. Here is a very nice, very short sample project which uses it (build your own webbrowser with almost no code): http://jrepp.com/cocoabb/viewtopic.php?t=32 http://jrepp.com/src/WeBrowser.tgz The question that remains is: can we add this to PyObjC somehow, so I can eat my HTML/NSTextView cake, too? ;-) Note, that I'd like to see a simple paragraph somewhere in the developer documentation that would explain to me how I can add such stuff myself, unless it's already there, of course... Thanks, Dinu -- Dinu C. Gherman ...................................................................... "Political satire became obsolete when Henry Kissinger was awarded the Nobel Peace Prize." (Tom Lehrer) |