Changing a NSTextField's value
Changing a NSTextField's value
- Subject: Changing a NSTextField's value
- From: "Paul J. Lucas" <email@hidden>
- Date: Tue, 28 Mar 2006 15:15:49 -0800 (PST)
So I have a dialog box that has to NSTextFields: one for a width
and one for a height. I have code that keeps the aspect ratio
the same, i.e., if the values are initially 100 and 100 and
then you type 50 in one, the other changes to 50 as you type.
This all works great.
Now I've added a Rest button that, when clicked, is supposed to
set the values back to their original values.
If I click Reset when neither text field has focus, they both
get reset and repainted; if I click Reset when one has focus and
the entire value is selected, they also both get repainted;
however, if the insertion-point cursor is blinking in one of
them, that field doesn't get repainted. It's like the fact that
the cursor is there is preventing either the resetting or the
repainting.
FYI, I'm using [myField setIntValue:origX] to set reset the value.
How do I get it to accept the new value and repaint even if the
cursor is in the field -- OR -- how do I get the cursor out of
the field (say by selecting the entire contents of the field)?
- Paul
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden