Re: [Pyobjc-dev] NibLoader.py: parsing nibs at runtime
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2002-11-16 19:55:49
|
Jack Jansen wrote: > On vrijdag, nov 15, 2002, at 11:39 Europe/Amsterdam, Ronald Oussoren > wrote: > > We could of course use a variant of mknibwrapper to generate > > userfriendly documentation instead of a python file. > > Not only documentation but also a skeleton implementation, similar to > the "generate .c/.h" from Interface Builder. (Where is this functionality? Can't find any menu for it in IB...) > And while we're at it: it would be a killer feature if NibLoader could > optionally use Python's introspection features to check that your > subclass actually implements all needed methods and such, so that if > you set NibLoader.DEBUG to true (or have that set automatically if the > environment variable PY_NIBLOADER_DEBUG is set) your classes are > checked for conforming to what the nib expects. Of course we can't go > any further than method names and number of arguments, but it would > still be a great tool. Right, this should actually be straightforward! What the NibClassBuilder metaclass currently does is add stub methods for actions not defined in the class itself, and add IBOutlets for outlets that haven't been defined "manually". It would be easy to print a warning to stderr at class-build-time if an action isn't defined. I think this flag should be True by default, though, since you're supposed to implement them all anyway. If you _choose_ to just keep the noop stub, _then_ you should set the debug flag to false... (I don't grok outlets just yet: are the default IBOutlet objects all that are ever needed, or are you supposed to provide them yourself?) Just PS: I still can't commit. Does anyone know whether it would be wise to open an sf support request yet, or should I be a little more patient? |