FROM : Graham Cox
DATE : Wed Mar 26 22:56:08 2008
The undo manager will directly change the data in the text view using
an invocation or target/action - it doesn't go back through
changeFont: normally, which is really a "high level" method.
Maybe the solution to this is to subclass NSUndoManager so that you
can hook into the undo and redo methods and use those opportunities to
modify the change count of the document. Since the undo manager itself
is the central object where the various invocations are collected,
it's going to be a lot easier to handle things there than to try and
trap all the individual invocations or method calls that it makes.
You can switch the document's undo manager early in the document
creation sequence.
------
S.O.S.
P.S. - I've done a lot of work with Undo lately, and really
understanding it takes some effort, especially if you need to do
something even slightly non-standard, so good luck!
On 26 Mar 2008, at 9:26 pm, Gerriet M. Denkmann wrote:
> I also can use Edit ► Undo Set (or Paste) Font but now the
> document gets dirty. Very bad. Also: the complete text gets selected.
> So what else do I have to implement? I tried setFont: and
> setFont:range:, but these seem never to be called.
> How does the NSUndoManager undo my font changes?
DATE : Wed Mar 26 22:56:08 2008
The undo manager will directly change the data in the text view using
an invocation or target/action - it doesn't go back through
changeFont: normally, which is really a "high level" method.
Maybe the solution to this is to subclass NSUndoManager so that you
can hook into the undo and redo methods and use those opportunities to
modify the change count of the document. Since the undo manager itself
is the central object where the various invocations are collected,
it's going to be a lot easier to handle things there than to try and
trap all the individual invocations or method calls that it makes.
You can switch the document's undo manager early in the document
creation sequence.
------
S.O.S.
P.S. - I've done a lot of work with Undo lately, and really
understanding it takes some effort, especially if you need to do
something even slightly non-standard, so good luck!
On 26 Mar 2008, at 9:26 pm, Gerriet M. Denkmann wrote:
> I also can use Edit ► Undo Set (or Paste) Font but now the
> document gets dirty. Very bad. Also: the complete text gets selected.
> So what else do I have to implement? I tried setFont: and
> setFont:range:, but these seem never to be called.
> How does the NSUndoManager undo my font changes?
| Related mails | Author | Date |
|---|---|---|
| Gerriet M. Denkman… | Mar 25, 18:48 | |
| Graham Cox | Mar 25, 23:12 | |
| Gerriet M. Denkman… | Mar 26, 03:07 | |
| Sherm Pendley | Mar 26, 04:07 | |
| Gerriet M. Denkman… | Mar 26, 11:26 | |
| Graham Cox | Mar 26, 22:56 | |
| Jens Miltner | Mar 27, 09:50 | |
| Gerriet M. Denkman… | Mar 27, 11:57 | |
| Jens Miltner | Mar 27, 14:46 | |
| Gerriet M. Denkman… | Mar 27, 18:44 | |
| Gerriet M. Denkman… | Mar 27, 18:48 |






Cocoa mail archive

