|
From: | Andreas Höschler |
Subject: | Re: Key Equivalent on button |
Date: | Wed, 19 Apr 2006 20:52:31 +0200 |
This at least works under MacOSX. On GNUstep this does not do anything. While
googling I found a hint regarding the modifier mask. I therefore also tried
[okButton setKeyEquivalent:@"\r"];
[okButton setKeyEquivalentModifierMask:NSControlKeyMask];
but this didn't chane anything. I found no key sequence (Return, Ctrl-Return,
Command-Return,...) that would cause the ok button to perform its action.
What am I missing? Any workaround (seems to be a GNUstep bug) or idea how thi
smight be fixed?
I do and it works:
[okButton setButtonType: NSMomentaryPushButton];
[okButton setKeyEquivalent: @"\r"];
[okButton setImagePosition: NSImageRight];
[okButton setImage: [NSImage imageNamed: @"common_ret"]];
[okButton setAlternateImage: [NSImage imageNamed: @"common_retH"]];
[okButton setTitle: _(@"OK")];
[okButton setTarget: [self windowController]];
[okButton setAction: @selector(okClicked:)];
[Prev in Thread] | Current Thread | [Next in Thread] |