[Pyobjc-dev] objc.BadPrototypeError
Brought to you by:
ronaldoussoren
From: Rob <rob...@gm...> - 2009-11-13 06:14:57
|
(Please tell me if this is the wrong list for this kind of thing) I am trying to port an application written against the stock python+pyobjc on Leopard to one on snow leopard, and I've hit and error I can't solve. I have a sheet that pops in that allows one to select files, and it does this: self.panel.beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo_( os.getcwd(), None, self.filetypes, NSApp().mainWindow(), self, 'openPanelDidEnd:panel:returnCode:contextInfo:', 0) the key being the 'openPanelDidEnd:panel:returnCode:contextInfo:' part. The signature of that method seems to have changed between Leopard and Snow Leopard, but the decorator in pyobjc doesn't appear updated. I am guess this is what is going on because my method defined as: @PyObjCTools.AppHelper.endSheetMethod def openPanelDidEnd_panel_returnCode_contextInfo_(self, panel, returnCode, contextInfo): (which works fine in Leopard) throws the error: objc.BadPrototypeError: Python signature doesn't match implied Objective-C signature for <unbound selector openPanelDidEnd:panel:returnCode:contextInfo: of desktop_uploaderAppDelegate at 0x2fb6d70> I've tried to figure out how to write the signature myself, but I seem to suck badly at doing so. Nothing I have tried has worked. I've tried (some were just googled, some I tired to write myself by looking at the apple docs): @objc.signature('v@:^@i^v') @objc.signature('v16@4:8@12i16i20') @objc.signature('v@:@i^v') amongst others, but everything I try just throws that objc.BadPrototypeError: and crashes the program. Seems like it should be an easy fix if I could sort out the signature - can anyone help or point me in the right direction? cheers, rob -- http://robrohan.com http://twitter.com/robrohan |