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: Dan Wood <email@hidden>
- Date: Tue, 27 Aug 2002 07:51:17 -0700
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".
And the problem is not that the button's action isn't dismissing the
sheet -- it works just fine if you press the button with the mouse --
but that the return key is ignored or being "eaten" as Jeremy says.
I'm not losing my button event -- just the return key event. And it
doesn't matter whether I've clicked on something in the window to make
sure it's first responder.
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
On Tuesday, August 27, 2002, at 06:28 AM, Jeremy Dronfield wrote:
The only thing you need to connect in IB is your button to its action
method. If you find this doesn't work, and that your button event is
being 'eaten', then something somewhere is preventing your sheet
becoming modal. In that case, search elsewhere in your code for the
cause.
-Jeremy
On Tuesday, August 27, 2002, at 06:44 AM, Adam Thayer wrote:
On 2002-08-27 14:28:46 +0100 Jeremy Dronfield
<email@hidden> wrote:
The only thing you need to connect in IB is your button to its action
method. If you find this doesn't work, and that your button event is
being 'eaten', then something somewhere is preventing your sheet
becoming modal. In that case, search elsewhere in your code for the
cause.
-Jeremy
But he wants to be able to hit 'return' and close the sheet, and it
isn't happening... so what if he hooks up the button? It still won't
have it react to the return button ;)
I personally think he just forgot to make sure there were no modifiers
set when he setup the button to accept the return key... but I can't
see the IB windows *grin*
_______________________________________________
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.
--
Dan Wood
Karelia Software, LLC
email@hidden
http://www.karelia.com/
Watson for Mac OS X:
http://www.karelia.com/watson/
_______________________________________________
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.