Re: [Pyobjc-dev] NSBeginAlertSheet trouble
Brought to you by:
ronaldoussoren
From: Dinu G. <gh...@da...> - 2003-06-19 06:35:17
|
I wrote: > Surprisingly that doesn't work for me (on the latest CVS version). > But using objc.selector() directly does work. I'm attaching the file > MyAppDelegate.py which you can replace the respective file with from > the "Cocoa Python Application" PB template to test. Also very strange: if I use in the same file these methods which try to save the return value of the sheet in a variable x for fur- ther use, I get an AttributeError and the app crashes before I even have a chance of clicking any button in the sheet itself: def sayHelloAction_(self, sender): # adapted from same method of the "Cocoa Python Application" PB template info = 0 makeAlertSheet("title", "msg", info, sender.window(), self) print self.x def sheetDidEnd_returnCode_contextInfo_(self, sheet, returnCode, info): print "sheetDidEnd_returnCode_contextInfo_", sheet, returnCode, info self.x = returnCode I don't know which other way one can use the returnCode, since the NSBeginAlertSheet() function itself returns only None... Dinu -- Dinu C. Gherman ...................................................................... "Political satire became obsolete when Henry Kissinger was awarded the Nobel Peace Prize." (Tom Lehrer) |