Re: [Pyobjc-dev] Interface builder?
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2002-10-25 11:08:48
|
On Thursday, Oct 24, 2002, at 02:01 Europe/Amsterdam, bb...@ma... wrote: > As Ronald indicated, you have to manually create the subclass of > NSObject (or whatever) in IB. Unfortunately, we don't currently have > a "create source files" that'll create Python source from within IB. > Well, maybe not true -- I saw in the repository that Ronald has > another bit of magic in the works. :-) This 'magic' is already in the installer on your site, I just haven't wired it up yet. And now on to a description of this magic feature... When you define a user-interface in Interface Builder one of the files that is written into the NIB named 'classes.nib'. This is a text file containing a description of the classes that are defined in the NIB. I've written a python module that can be used to read this file and generate a module containing class definitions. In your own code you just import this module and subclass from the generated classes to define the classes from the NIB. Advantages are: - No need to manually define 'IBOutlet' entries (outlets in Interface Builder) - No need to manually specify the signature for actions - No manual sync between definitions in IB and python code. I'll probably change one or more of the examples to use this script, but that will have to wait until we've fixed some problems with the C code and have written some more tests and documentation. Ronald |