Re: Why would sheet's default button not respond to return key?
Re: Why would sheet's default button not respond to return key?
- Subject: Re: Why would sheet's default button not respond to return key?
- From: Isaac Sherman <email@hidden>
- Date: Tue, 27 Aug 2002 13:00:35 -0400
on 8/27/02 10:51 AM, the method -(id)email@hidden:(id) sender:@"Dan
Wood"; returned:
>
I've just checked, and the OK button has a key equiv of \R (return)
>
with no modifiers, it's a push button, the only checkboxes checked are
>
"bordered" (grayed out) and "Enabled".
Same as mine. Always good to check.
>
The only fragment of code that I can think of that might be relevant is
>
how the sheet is opened ... anybody see anything unusual with this?
>
>
[NSApp
>
beginSheet:oWindow // outlet to the NSPanel that is created in my
>
nib along with the controller object
>
modalForWindow:inWindow // NSWindow holding the sheet
>
modalDelegate:self
>
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
>
contextInfo:nil];
>
// I even added this line for good measure, but no avail.
>
[oWindow enableKeyEquivalentForDefaultButtonCell];
>
>
What would be most useful would be a way to trace the path of a
>
keystroke. Any clues as to what I could do -- pose a class or
>
something -- to see where my return key is getting sent?
>
>
Dan
>
>
This code works on my machine:
[NSApp beginSheet:oWindow
modalForWindow:inWindow
modalDelegate:nil
didEndSelector:nil
contextInfo:nil];
[NSApp runModalForWindow:oWindow];
[NSApp endSheet:oWindow];
[oWindow orderOut:self];
And the button is connected to an action which sends:
[NSApp stopModal];
Perhaps the modal delegate being nil helps?
HTH,
--
Isaac Sherman
MotaSoft Software
http://homepage.mac.com/huperzoevs/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.