Re: [Pyobjc-dev] Python subclasses of NSView?
Brought to you by:
ronaldoussoren
From: Etienne P. <ep...@ep...> - 2003-01-08 13:36:10
|
On Wednesday, Jan 8, 2003, at 14:07 Europe/Amsterdam, Dinu Gherman wrote: > I'm trying to find out if it is possible to have Python subclasses > of graphic widgets like NSView, say? I can't quite figure out how > to tell IB about a new Python file containing the subclass and then > change a "custom view" widget to be of the new class, MyView, say. > > With Obj-C you tell IB by making it read the MyView.h file, and > then you can switch a custom view from the container views palette > to the new MyView class. How would I do this for a Python subclass? Have a look at: http://www.cs.vu.nl/~etienne/pyDotView.tar.gz It is the 'DotView' example from the Apple 'Learning Cocoa' book converted to a Python App. I think the source code will make it clear, a single custom class with instance in IB for the Custom View, and then the code in Python for that class. Etienne |