Re: Undo stack for GTK+ (was: Re: undo in textview)



On Mi, 30.12.2009 21:32, Tristan Van Berkom wrote:

>Particularly point 5, nested transactions; I banged my head around that one
>for a while and finally did not implement this; my interpretation of
>nested transactions
>was something like this:
>  o User initiates action
>  o action goes and modifies data on the model
>  o model data change callback initiates "nested action"
>
>  a.) it was complex as hell to implement without re-creating commands
>       when the data model changes due to undo/redo or something other
>than an action
>      (and however nice the api, the complexity spills into the
>individual action initiating code).

I don't really see the problem in nesting groups of undo stack elements.

Quite on the contrary, I find it very useful, if not essential, to be
able to use the stack from applications that don't follow the command
pattern already anyways.

>without making a huge unusable command stack (i.e. Glade uses this for
>instance; to make sure
>that 15 edits to a string property will only show up as one command).

Qt's undo stack implementation has something along these lines.

>Also finally, it would be nice to see this targeted somewhere below
>GTK+ in the stack, would be
>a shame to do all this work and not be able to use it from; say;
>Clutter apps or such...

True, I would have put it below GTK+ too, but given that such a stack
requires GObject, I didn't really find a better-fitting place. Also,
being able to rely on GTK+ has advantages, too, like being able to offer
convenience GtkAction's for undo and redo with up-to-date labels.

Holger


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]