From: Jonathan P. <jp...@dc...> - 2006-01-20 21:12:09
|
On 20 Jan 2006, at 20:49, Dave Howell wrote: > def alertDidEnd_returnCode_contextInfo(theAlert) > return > end > > Unfortunately, I can't do anything but one-button messages, because > I can't get the return code back from the NSAlert. The call to > 'beginSheetModalForWindow...' looks like this in Objective-C: > > beginSheetModalForWindow:[someWindow window] > modalDelegate:self > didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) > contextInfo:nil > > How exactly can I get a parameterized selector into this thing? In > other words, how do I do > @selector(alertDidEnd:returnCode:contextInfo:) > in RubyCocoa? Is your callback method being called? Your ruby method: def alertDidEnd_returnCode_contextInfo(theAlert) doesn't have the right signature, because it's supposed to take three arguments: def alertDidEnd_returnCode_contextInfo(theAlert,code,context) Does using the 'code' argument there work? I think you can also use symbols for selectors (instead of strings) e.g., :alertDidEnd_returnCode_contextInfo. Don't think it makes any difference, just a matter of choice. Hope that helps, Jonathan |