Re: Naive Pop-Up Button Example
Re: Naive Pop-Up Button Example
- Subject: Re: Naive Pop-Up Button Example
- From: Greg Titus <email@hidden>
- Date: Sun, 23 Sep 2001 14:57:46 -0700
On Sunday, September 23, 2001, at 12:34 PM, Lizardo H. C. M. Nunes wrote:
From: Ondra Cada <email@hidden>
This I kind of don't understand. If you mean that "your code called
[textField setEditable:NO], and the field is still editable
afterwards", that
would be quite strange. Are you _sure_ you don't call [textField
setEditable:YES] later in the same event?
Yes, I'm sure. But once I press "return" it becomes non editable
again (?).
The problem you are having is that the -setEditable: call really means
something more like "setIsAbleToStartEditing". If you are already in the
middle of editing the text field it won't have any effect until the next
time you try editing.
If you add [[textField window] makeFirstResponder:nil] in the same
action where you are doing setEditable:NO, you'll get what you want. The
window will take first responder status away from the active control (in
this case the text field), and then you won't be able to edit it again.
Hope this helps,
-Greg