Naming question (was: [Pyobjc-dev] Cocoa Sheets)
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-06-11 18:11:53
|
I think we should add a function that allows you to declare that a method is used as the callback for a sheet, that way uses don't have to guess the right value of the signature string. That brings me to a difficult question: How should we name that function. How about: def NSSheetEndMethod(meth): return selector(meth, signature='v@:@ii') Obvious alternatives are: * NSEndSheetMethod * NSSheetCallback I'm afraid I don't see a way to automaticly detect that a method will be used as the callback for a sheet. Ronald On Wednesday, Jun 11, 2003, at 18:22 Europe/Amsterdam, Bob Swerdlow wrote: > I'm trying to use > NSApplication.beginSheet_modalForWindows_modalDelegate_didEndSelector_c > ontex > tinfo_ to create a sheet on a window, but I don't seem to be setting > it up > right . When it goes to call the didEndSelector method I get a bus > error :( > > The method that I want called is defined in class MyClass as: > def sheedDidEnd_sheet_returnCode_contextInfo_(self, sheet, > returnCode, > contextInfo): > > I'm trying to invoke the sheet as: > > application.beginSheet_modalForWindow_modalDelegate_didEndSelector_cont > extin > fo( \ > self.panel, self.window, self, > sheedDidEnd_sheet_returnCode_contextInfo_selector, 0) > > where I have set up sheedDidEnd_sheet_returnCode_contextInfo_selector > with: > sheedDidEnd_sheet_returnCode_contextInfo_selector = objc.selector \ > (sheedDidEnd_sheet_returnCode_contextInfo_, signature='v@:@ii') > > I don't see where the signature format is specified, so I took a guess > (!) > How do I define the selector so that method gets called correctly? Is > there > a better way to do this? > > Thanks for your help. > > Bob Swerdlow > COO > Transpose > rsw...@tr... > 207-781-8284 > http://www.transpose.com > > ---------------------------------- > Fight Spam! > Add this link to your signature (as I did): http://wecanstopspam.org > Click through to find out more. > ---------------------------------- > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: eBay > Great deals on office technology -- on eBay now! Click here: > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |