Re: Generic undo stack for GTK+



On Mon, 21 Jun 2010 12:57:44 +0200 ecyrbe wrote:

> Easy Undo/Redo framework are usually based on Inheritance...

I don't have any statistics, but surely, there are many frameworks
based on inheritance, and many others that aren't. The question is
more: Does it make sense to base it on inheritance (or interfaces)?
What is gained by the additional complexity and cost? Personally, I
don't think inheritance makes sense here. It's not an object that is
undoable, but a function.

> Anyway, i don't see the value of adding it to GLib, as undo
> frameworks are only an abstraction, and users end-up doing the
> painfull job of implementing undo commands for every type of objects
> or actions they are putting in the stack or the tree.

Aeh -- it's a container type. Of course no generic container type
gets any application specialized functionality for free. Nobody claimed
that.

What it does get you is other things, for example

- Your stack will behave consistently with other applications using the
  same stack implementation.
- Undo could be introduced in GTK+ itself (e.g. TextView/TextBuffer).
- You don't have to write the boring boiler-plate code yourself, which
  is likely to motivate application developers to actually offer undo
  in their applications.

(As an semi-off-topic side note concerning the last point, I'm quite
impressed on how the inclusion of the GtkInfoBar widget has positive
implications on general GTK+ application usability. Having that kind
of stuff just available does make a difference.)

Holger


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