Re: [Pyobjc-dev] PyShellView?
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-07-02 10:15:40
|
On Wednesday, Jul 2, 2003, at 10:32 Europe/Amsterdam, Dinu Gherman wrote: > I wrote: > >> Sounds good to me! You may want to sniff into the following maybe: >> >> >> http://developer.apple.com/samplecode/Sample_Code/Cocoa/ >> TextViewDelegate.htm >> >> Have fun, > > Big fun, indeed!! The following conversion to PyObjC using an outlet > named 'committedLength' of type id in IB just crashes: I cannot reproduce this here using the attached files and 'English.lproj' from the example. the main.py is your crashing code with an added call to NSApplication main, and adapted for the name of the nib inside the example. Could you post a complete, crashing, example. <later> Now that I look at your message again I see what's wrong: don't use outlets to store the committedLength. If you store anything in outlets you must make sure that that object stays alive by other means (e.g. store a reference in a regular instance variable or even call 'retain'). That doesn't help for "plain python" value though, therefore you shouldn't store plain-python values in outlets. I'm going to add something about this issue to the documentation. Basic guideline: Only use outlets if you're going to set them from Interface Builder, otherwise use "regular" instance variables. Ronald |