Re: [Pyobjc-dev] problem with NSTableView
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-03-13 20:07:54
|
On Thursday, Mar 13, 2003, at 14:56 US/Eastern, chris bunker wrote: .... > self.knownEntities is a Python object that inheriting > from NSObject and implementing the informal > NSTableDataSource protocol. At this point it contains > no data to display as I'm just setting the program up > at this point. > > .... > class entityTable(NSObject): ... Change the declaration to: > class entityTable(NSObject, NSTableDataSource): (BTW: Normally, that class would be called 'EntityTable' to be consistent w/ObjC and Python naming conventions.) -- When implementing one of the informal protocols, you need to specifically declare [in Python] that you are doing so. This allows PyObjC to figure out the correct types for the arguments to the method. The alternative is to use the objc.selector() function to declare the appropriate types on the methods -- but that is considerably more tedious. I posted a relatively long message a few days [weeks?] ago that explains informal protocols and their implementation in Python via PyObjC -- see the list archives. b.bum (Stuck in Cocoa/Java land right now.... makes me appreciate Cocoa/Python all the more) |