Re: [Pyobjc-dev] NSSavePanel causing SIGBUS 10
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2003-04-29 07:40:56
|
Greg Hamilton wrote: > Hello, > > We're trying to display a standard NSSavePanel save file sheet. > The save sheet is displayed. > The Cancel button works. > Save causes a SIGBUS 10. > Any clues ? > > def saveAs_(self, sender): > sp = NSSavePanel.savePanel() > > sp.beginSheetForDirectory_file_modalForWindow_modalDelegate_didEndSelect > or_contextInfo_( > '~/Documents', > None, > self.mainWindow, > self, > 'didEndSheet:returnCode:contextInfo:', > 0) > print "end of save as" > > def didEndSheet_returnCode_contextInfo_(self, sheet, return_code, > contextInfo): > print 'Did End' > if return_code == NSOKButton: > self.filename = sheet.filename() > print "saving %s items as %s" % (len(self.sched), > self.filename) > self.sched.save(self.filename) You need to specify the exact signature of your didEndSheet_etc method: returnCode is an int argument and PyObjC can't guess that. After your method definition, add: didEndSheet_returnCode_contextInfo_ = objc.selector(didEndSheet_returnCode_contextInfo_, signature="v@:@ii") (I'm not sure I got this right as I don't know where that signature syntax is defined and I have no time to actually run the code.) Just |