Re: Undoable controls
Re: Undoable controls
- Subject: Re: Undoable controls
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 08 Sep 2005 06:40:04 -0400
on 2005-09-07 9:44 PM, Frode at email@hidden wrote:
> I have heard some rumors that NSTextField should be undoable, but is
> this true on version starting from Mac OS X 10.2?
Text fields have always been undoable AFTER you commit editing, just as
other controls are undoable -- assuming you write the necessary undo
registration code for each control, as explained in the documentation that
others have referred to.
The issue of "live" undo in a text field is more complicated. This has to do
with getting an "Undo Typing" menu item every time you edit the text within
a text field that has not yet been committed. In a practical sense, live
undo of text fields was not available prior to Tiger, but it is available
and turned on by default in Tiger.
Prior to Tiger, you could go into the window's field editor (where the text
field's editing is actually carried out) and turn on its text view's "can
undo" flag. I think you can even do this in IB. But it never worked
satisfactorily and was not advertised as an available feature of text
fields.
In my book "Cocoa Recipes for Mac OS X: The Vermont Recipes," I have a short
chapter showing how you can implement live undo in text fields prior to
Tiger. It works much better than simply turning on the field editor's can
undo flag, but it still has some problems that, in my post-publication
opinion, make it unusable as a practical matter.
Apple's Tiger implementation of live undo in text fields is much better --
but I have recently found a case where it fails, too.
--
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