FROM : Daniel Child
DATE : Thu Feb 21 20:55:27 2008
From what I read, the default (button in a view is outlined/shaded
in blue and is set as the button which responds to RETURN. I have a
serious of buttons (step 1, step 2, etc.), and I want the appropriate
button to be highlighted as the default when it is turn to do that
step. I used this code within a "showWindow" method which loads the
window.
int stepsCompleted = [[dataValues objectForKey: @"steps completed"]
intValue];
switch (stepsCompleted)
{
case 0:
[step1Button setKeyEquivalent:@"\r"];
break;
case 1:
[step2Button setKeyEquivalent:@"\r"]; // works
[step1Button setKeyEquivalent:@""]; // but blue edge does not
move to button 2
break;
....
From When I do this, the correct button does indeed respond to
RETURN. But the blue highlight remains on the first button. I also
tried [<button> setHighlight: <YES/NO>] to control the highlighting
state, but with square buttons that simply makes them a dark grey and
does not affect the blue outline.
In the nib, all of the buttons are marked as having no key
equivalent. I should note that I am using the square button shape. Is
this a bug?
DATE : Thu Feb 21 20:55:27 2008
From what I read, the default (button in a view is outlined/shaded
in blue and is set as the button which responds to RETURN. I have a
serious of buttons (step 1, step 2, etc.), and I want the appropriate
button to be highlighted as the default when it is turn to do that
step. I used this code within a "showWindow" method which loads the
window.
int stepsCompleted = [[dataValues objectForKey: @"steps completed"]
intValue];
switch (stepsCompleted)
{
case 0:
[step1Button setKeyEquivalent:@"\r"];
break;
case 1:
[step2Button setKeyEquivalent:@"\r"]; // works
[step1Button setKeyEquivalent:@""]; // but blue edge does not
move to button 2
break;
....
From When I do this, the correct button does indeed respond to
RETURN. But the blue highlight remains on the first button. I also
tried [<button> setHighlight: <YES/NO>] to control the highlighting
state, but with square buttons that simply makes them a dark grey and
does not affect the blue outline.
In the nib, all of the buttons are marked as having no key
equivalent. I should note that I am using the square button shape. Is
this a bug?
| Related mails | Author | Date |
|---|---|---|
| Daniel Child | Feb 21, 20:55 | |
| Ken Ferry | Feb 21, 21:29 | |
| Daniel Child | Feb 21, 22:13 | |
| Daniel Child | Feb 22, 01:06 |






Cocoa mail archive

