Re: [Pyobjc-dev] Confused on syntax
Brought to you by:
ronaldoussoren
From: Steven D. M. <sd...@mi...> - 2001-04-27 18:42:11
|
[ I know our mails have crossed, and I addressed some of this in the earlier, longer message, but to distill the problems down more concisely: ] > class ConverterController(pyobjc.runtime.NSObject): [1] That won't work for the same reason you can't directly subclass Python lists or dictionaries. They are objects, but not classes. Look in you're Python lib for UserDict.py and UserList.py -- which are examples of class wrappers around a non-class object. You would need to do something similar for Cocoa classes -- which are not Python classes. We're going to look for a general solution to this problem: Jim Fulton and Don Beaudry both (I think) did some work on "extension classes" and other ways around this problem in Python -- and I think Python is moving towards a more general solution eventually. We might try fixing it without waiting for Python 2.X to fix the problem (looking at those previous attempts). We might be able to add more introspection to the bridge to make it easier to automatically generate, or make a generic one-size-fits-all class wrapper. [2] I haven't yet been able to load and reanimate an IB Nib file from Python. I think this is a much easier problem than [1] above. I'll try to post what I've tried and what didn't work in case anyone else wants to give it a try. -- Steve Majewski |