"Continuously Updates Value" and Undo
"Continuously Updates Value" and Undo
- Subject: "Continuously Updates Value" and Undo
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 18 Aug 2005 16:50:39 -0400
In my Core Data app, I turn on the "Continuously Updates Value" option in
the value bindings of several text fields, because I like to watch the
corresponding table row type along with me.
However, when I choose Undo after typing several characters (but not
pressing return or tabbing out of the field), I get unpleasant behavior. My
first Undo ("Undo Typing" in the menu, apparently because text field undo is
turned on by default in Tiger) correctly removes all of the characters at
once. However, that leaves another Undo menu item waiting for me ("Undo Set
Name", apparently because I set that as the action name in my managed
object's -setName: method). Choosing this second Undo item causes the text
to reappear in the field, apparently because the first Undo ("Undo Typing")
invoked -setName: with a nil parameter to undo my initial typing. Then I can
undo several more times, and each time I do this my characters are deleted
one at a time until they're all gone and the undo stack is finally cleared.
If I end editing before choosing Undo, that gets rid of Undo Typing. But now
Undo Set Name undoes my typing only one character at a time.
What's going on?
Should I turn off default undo in text fields that have Continuously Updates
Value turned on? But I'll have to declare an IBOutlet for each text field,
which goes against the bindings grain, and the user will see inconsistent
Undo naming depending on the text field.
Should I disable undo registration in my -setName: method? I tried that and
it helps, but I still get a single unidentified Undo after Undo Typing,
which appears to do nothing.
Should I give up on using Continuously Updates Value in text fields?
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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