Re: [Pyobjc-dev] Two difficulties with document-based app
Brought to you by:
ronaldoussoren
From: David E. <epp...@ic...> - 2002-12-11 21:20:41
|
On 12/11/02 3:13 PM -0500 bb...@ma... wrote: > I haven't looked at the other specific problems, but will soon.... > however, you should really use the version in CVS. We are on the verge > of shipping 0.8 and it is leaps and bounds better than 0.7. Ok, I guess. I was holding off because I had the impression the 0.8 release was imminent and it seemed like a better idea to wait until a relatively stable release than to try to hit a moving and sometimes buggy target. When is the 0.8 release expected? > We are going to cut 0.8 before doing a Cocoa-Python Multiple Document > template, but that template will be one of the first things I do once 0.8 > ships. I'd be happy to share my code but I'm not sure how useful you'd find it. What I remember doing to make a document-based app was: - Create class MyDocument (NSDocument) with methods modeled on the ObjC template (all I'm currently implementing are init and windowNibName, more to come later). - Move the window and associated objects from MainMenu.nib to MyDocument.nib (the same nib whose name was returned from MyDocument.windowNibName) - Set the "File's Owner" class in MyDocument.nib to MyDocument so I could set some outlets on it. - Create a document type in the target having MyDocument as its document class Anyway, I want to say thank you, because writing this all out has helped me track down one of the two bugs that were the subject of my previous message. It turns out that the "Before DECREF in normal" / "Release with dead python" messages are caused by the outlets on File's Owner. If I don't set those outlets, the messages stop happening and my bus errors go away. Is this a bug in pyobjc or in my understanding of how to use it? I can easily work around this by moving all the functionality from MyDocument to another object created within the nib, but it would be helpful to understand whether outlets to File's Owners are ok. -- David Eppstein UC Irvine Dept. of Information & Computer Science epp...@ic... http://www.ics.uci.edu/~eppstein/ |