Re: [Pyobjc-dev] NibLoader.py: parsing nibs at runtime
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2002-11-16 22:45:59
|
bb...@ma... wrote: > Ahhh... now I understand. From the Python-Cocoa template, I see the=20 > declaration of.... >=20 > messageTextField =3D IBOutlet("messageTextField") >=20 > .... but, in the implementation, I see... >=20 > self.messageTextField.setStringValue_( helloString ) >=20 > .... so, yes, it appears that IBOutlet() creates a declaration for an=20 > ivar that is then shared among all classes. Yet, each individual=20 > instance gets its own instance variable slot for that particular ivar. Ok, things are getting somewhat clearer, thanks! (But now I'm wondering w= ho's setting these ivars: is it Cocoa or the Py/Obj-C bridge?) > Slightly confusing from the Python perspective, definitely. My ObjC=20 > background is such that I didn't think twice about it until just now.=20 > :-) >=20 > > PS: should we rename NibLoader.py to something more appropriate, too? >=20 > Yes, it probably should be renamed as it is not analogous with=20 > NSNibLoading at all. I'm not sure what, though. >=20 > NibClassLoader? Or NibClassBuilder? Do you have any thoughts about from AppKit.NibClassBuilder import NibClassBuilder class PyModel(NSTableSource): __metaclass__ =3D NibClassBuilder ... vs. from AppKit.NibClassBuilder import AutoBaseClass class PyModel(AutoBaseClass, NSTableSource): ... ? Today I'm leaning towards the latter ;-) Just =B4 |