Naive Pop-Up Button Example
Naive Pop-Up Button Example
- Subject: Naive Pop-Up Button Example
- From: "Lizardo H. C. M. Nunes" <email@hidden>
- Date: Sun, 23 Sep 2001 00:18:30 -0300
Hi,
I'm playing around with this quite naive example of NSPopUpButton which has
only one action (called "myAction"), trigged by the Pop-Up Button (outlet
"myPopUpButton" ) and sent to a NSTextField ( "textField" ). The action has
three if's as below:
if( [title isEqualToString:@"Editable" ] )
{
[ textField setEditable: YES ];
[ textField setObjectValue: title ];
[ textField setBackgroundColor:green ];
}
if( [title isEqualToString:@"not Editable" ] )
{
[ textField setEditable: NO ];
[ textField setObjectValue: title ];
[ textField setBackgroundColor:white ];
}
if( [title isEqualToString:@"red Background" ] )
{
[ textField setBackgroundColor:red ];
[ textField setObjectValue:title ];
[ textField setEditable: NO ];
}
where "title" is the titleOfSelectedItem. It works fine till I write on the
textField something with the "Editable" choice "turned on". Choosing any of
the other two choices actually displays the new "title" and changes the
background color, but it don't set it as non editable, I'm still able to
write on it.
Why is that?
Thanks in advance,
Lizardo H. C. M. Nunes
...But we preach Christ crucified, to the Jews a stumbling block, and to the
Greeks foolishness;(...)but God has chosen the foolish things of the world
to confound the wise, and God has chosen the weak things of the world to
confound the things which are strong;(I Cor.1:23&27)