• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Out-of-order Undos and NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Out-of-order Undos and NSTextField


  • Subject: Re: Out-of-order Undos and NSTextField
  • From: Bill Cheeseman <email@hidden>
  • Date: Mon, 10 Jul 2006 13:57:03 -0400
  • Thread-topic: Out-of-order Undos and NSTextField

on 2006-07-10 1:08 PM, Ken Victor at email@hidden wrote:

> just so you know you are not alone, i've encountered the same problem
> and in a little experimentation, i didn't find a solution either.
> hopefully, someone will respond.
>
>> At 11:14 PM -0700 7/9/06, James Bucanek wrote on Saturday, July 8, 2006:
>>
>>> How do I get these to operate in the correct order? Do I have multiple Undo
>>> managers at work here? How can I coordinate them or use just one?
>>
>> Just to follow up on my own post, the NSUndoManager returned by the
>> NSTextField and the document are the same, so I don't have two
>> conflicting undo stacks.
>>
>> I've checked that -[NSUndoMaanager groupsByEvents] returns YES, so
>> every pass through the event loop *should* result in a distinct
>> top-level undo group.
>>
>> So how/why can a registered undo action that occured *after* the
>> text field was edited get put in the undo stack *before* the text
>> field changes?
>>
>> I'm really confused.
>>
>> James
>>
>> P.S. I also tried creating a sub-class of NSTextField that returned
>> nil for -[NSResponder undoManager], but that just caused all kinds
>> of problems.
>>
>> P.P.S. I also tried putting my undo actions together in a group, but
>> that didn't make any difference.

A chapter in my book (written in Jaguar days) shows how you can implement
"live" undo and redo in text fields. It's very tricky, and my technique does
have some problems. Apple came along later and tried to do it themselves,
but as you see they haven't got it quite right either.

Cocoa Recipes for Mac OS X-The Vermont Recipes (Peachpit).

--

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

  • Follow-Ups:
    • Re: Out-of-order Undos and NSTextField
      • From: James Bucanek <email@hidden>
References: 
 >Re: Out-of-order Undos and NSTextField (From: Ken Victor <email@hidden>)

  • Prev by Date: Re: NSData to NSString encoding error
  • Next by Date: Re: Getting a bundle to load symbols from the main app bundle
  • Previous by thread: Re: Out-of-order Undos and NSTextField
  • Next by thread: Re: Out-of-order Undos and NSTextField
  • Index(es):
    • Date
    • Thread