Re: Adding actions to undo manager

2009-06-15 Thread Kyle Sluder
I don't know where your -doCustomThing: method lives, what it does, or how it's invoked. All I know is that it manipulated an NSTextStorage. In NSTextView land, the topmost methods that manipulate text storages are things like -cut: or -insertText:. They know what undo actions to register with t

Re: Adding actions to undo manager

2009-06-15 Thread Ryan Joseph
On Jun 16, 2009, at 8:34 AM, Kyle Sluder wrote: On Mon, Jun 15, 2009 at 6:18 PM, Ryan Joseph> wrote: I'm not sure I follow you. How do I know the user wants to undo and that it was in response to my change of the NSTextStorage? It seems like one way or another I need to keep a stack of chang

Re: Adding actions to undo manager

2009-06-15 Thread Kyle Sluder
On Mon, Jun 15, 2009 at 6:18 PM, Ryan Joseph wrote: > I'm not sure I follow you. How do I know the user wants to undo and that it > was in response to my change of the NSTextStorage? It seems like one way or > another I need to keep a stack of changes with information on what operation > they perfo

Re: Adding actions to undo manager

2009-06-15 Thread Ryan Joseph
On Jun 15, 2009, at 10:16 PM, I. Savant wrote: Thanks. What a challenge just for some basic undo support, there really should be something simpler than this. There is, and it's already been suggested. If you want higher-level functionality, use the higher-level facilities of the text sy

Re: Adding actions to undo manager

2009-06-15 Thread I. Savant
On Jun 15, 2009, at 3:35 AM, Ryan Joseph wrote: Thanks. What a challenge just for some basic undo support, there really should be something simpler than this. There is, and it's already been suggested. If you want higher-level functionality, use the higher-level facilities of the text

Re: Adding actions to undo manager

2009-06-15 Thread Ryan Joseph
Thanks. What a challenge just for some basic undo support, there really should be something simpler than this. On Jun 15, 2009, at 1:08 PM, Kyle Sluder wrote: If you want undo manager support, you need to either perform the undo machinations yourself, or target your modifications at an entity

Re: Adding actions to undo manager

2009-06-14 Thread Kyle Sluder
If you want undo manager support, you need to either perform the undo machinations yourself, or target your modifications at an entity higher up in the text system chain. More information (along with an incomplete and perhaps misguided implementation) can be found on the CocoaDev wiki: http://www.

Adding actions to undo manager

2009-06-14 Thread Ryan Joseph
Simple question, how is it possible to have changes made programatically to NSTextStorage be added to the undo manager? I tried enclosing the changes in begin/endEditing calls but this did not work. Thanks in advance. Regards, Josef ___