Re: [Pyobjc-dev] getRectsBeingDrawn:count: signature help
Brought to you by:
ronaldoussoren
From: Ronald O. <ron...@ma...> - 2004-04-14 19:16:13
|
On 14-apr-04, at 20:07, Ted Horst wrote: > > I would like to use getRectsBeingDrawn:count: in a python NSView > subclass, > but I don't know how to declare the signature properly. I tried: > > setSignatureForSelector('NSView', 'getRectsBeingDrawn:count:', > 'v@:o^{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^i') > > and I get a rect back, but the data is bogus (not surprisingly). If I > use: > > setSignatureForSelector('NSView', 'getRectsBeingDrawn:count:', > 'v@:o^^{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^i') > > I get something back (a PyObjCPointer), but I don't know how to access > it. > > What is the proper signature and usage of a method like this (ie one > that > returns a variable length list of struct through a pointer to a > pointer). This cannot be solved in plain python, because the first argument is used to return an array of objects. This is fixed in revision 1.6 of Modules/AppKit/_AppKitMapping_NSView.m, which should surface in a day or so. With that you can do:: rects, count = myView.getRectsBeingDrawn_count() Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |