discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key Equivalent on button


From: Andreas Höschler
Subject: Re: Key Equivalent on button
Date: Wed, 19 Apr 2006 20:52:31 +0200

Hello Ludovic,

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:)];

I must be doing something wrong. I copied your code. Now I get the little arrow image which I suppose has nothing to do with the key equivalent mechanism, but pressing return while in the text field still does not perform the action of the button. No idea, whether or why the NSTextField would catch the key stroke!? Is this something that has been fixed very recently in GNUstep? My tree is already a few weeks old.

Regards,

Andreas






reply via email to

[Prev in Thread] Current Thread [Next in Thread]