[Pyobjc-dev] Subclassing NSCell?
Brought to you by:
ronaldoussoren
From: Mitch C. <mit...@ea...> - 2003-05-13 05:35:03
|
Does anyone have examples of subclassing NSCell from within a Cocoa-Python Document-based application? I'm trying to do this with Python 2.3b1 and PyObjc-0.9. I can create instances of the subclass, defined roughly as from AppKit import * class MyCell(NSCell): ... and can install these instances as data cells for NSTableColumns in an NSTableView. All cool. But if I try to override drawInteriorWithFrame_inView_, as follows, I get a segmentation fault on the first attempt to draw cell contents. What's more, I don't get the output from the print statement. def drawInteriorWithFrame_inView_(self, cellFrame, controlView): print "drawInteriorWithFrame_inView_" return super(MyCell, self).drawInteriorWithFrame_inView_(cellFrame, controlView) Note: I also get the segfault if I comment out the return statement. If I create an instance from an interactive Python shell and invoke drawInteriorWithFrame_inView_ manually, with None for both arguments, I at least get the print statement output. Thanks for guidance! -- Mitch |