Re: NSButton setKeyEquivalent doesn't seem to work
Re: NSButton setKeyEquivalent doesn't seem to work
- Subject: Re: NSButton setKeyEquivalent doesn't seem to work
- From: Randall Meadows <email@hidden>
- Date: Wed, 16 Jul 2008 15:22:32 -0600
On Jul 16, 2008, at 3:12 PM, Brian Hughes wrote:
I want the default button to reflect where the user has decided to
enter information. I have a sign up / log in page. If the user is
new and is signing up I want the signUp button to be the default but
if the user is already signed up and elects to use the log in field
I want the logIn button to be default.
I have assigned the signIn Button to be the default in Interface
Builder by designating the key equivalent to be the return key.
When the user elects to log in I want the default button to become
the logIn Button. Here is my code:
- (void )controlTextDidBeginEditing: (NSNotification *) aNotification
{
if ([logInNameField isEqual: [aNotification object]])
{
[logInButtonOutlet setKeyEquivalent: @"/r"];
You probably want "\r" there.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden