[Pythonmac-SIG] Knock me over with a spoon! [was: getting at the XML in nib files]

Steven Majewski sdm7g@Virginia.EDU
Thu, 17 Jan 2002 18:55:09 -0500 (EST)


On Thu, 17 Jan 2002, Steven Majewski wrote:

>
> >>> o.nibInstantiateWithOwner_( app )
> 2002-01-17 18:30:14.247 python2.1[419] Unknown class `Foo' in nib file,
> using `NSObject' instead.
> 2002-01-17 18:30:14.252 python2.1[419] Could not connect the action seed:
> to target of class NSObject
> 2002-01-17 18:30:14.261 python2.1[419] Could not connect the action
> generate: to target of class NSObject
>
> And the window popped up on the screen -- non functioning because this
> was a nib from Random.App in Aaron Hillegass's book, and, as you can
> see from the messages above, the targets in the nibs didn't match up
> with any of the classes in Python.
>


And, I expect that those targets come from the classes.nib file,
which is one of the XML text files. It might be possible to
just edit that file and replace CLASS and ACTIONS with another
class and methods. Now, the trick would be to figure out how
to link it to a Python object. Don't know if that's possible,
or if it will be more possible with new version that fixes
the class/type split.

{
    IBClasses = (
        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject;
},
        {
            ACTIONS = {generate = id; seed = id; };
            CLASS = Foo;
            LANGUAGE = ObjC;
            OUTLETS = {textField = id; };
            SUPERCLASS = NSObject;
        }
    );
    IBVersion = 1;
}


-- Steve