Re: [Pyobjc-dev] NSBeginAlertSheet trouble
Brought to you by:
ronaldoussoren
From: Dinu G. <gh...@da...> - 2003-06-19 08:11:01
|
Just van Rossum: > NSBeginAlertSheet() returns _immediately_, and therefor your x > attribute > will only be available after sheetDidEnd_etc. was called. Sheets are > modal to the window, not the entire app, so while the sheet is up there > the event loop continues as usual. That's why it uses callbacks instead > of a return value... Uhm, right, probably lack of sleep... :-/ The following will do it: def sayHelloAction_(self, sender): info = 0 makeAlertSheet("title", "msg", info, sender.window(), self) def sayHelloActionContinued(self): print self.x def sheetDidEnd_returnCode_contextInfo_(self, sheet, returnCode, info): self.x = returnCode self.sayHelloActionContinued() Dinu -- Dinu C. Gherman ...................................................................... "A whole generation has grown up with the idea that it is normal for them to have no freedom." (Richard M. Stallman) |