Re: Undo framework



On Fri, 2007-09-21 at 17:51 +0100, Iain * wrote:
> Hi,
> 
> I've had an undo framework in Marlin for years now, but recently
> people have been using it in other things (notably Ross in Tasks - ok,
> actually, he's the only one) and we discussed suggesting this for
> inclusion in GTK at some point in the future. QT4[1] and Cocoa[2] both
> have very similar frameworks. Attached are the header files.

Hi,
   I think that would be a great thing to add to gtk+ if only to
encourage software authors to write undoable code - the brief
description of the framework pretty much matches the implementation
in glade to the letter (we started out with "command" objects which
had undo/redo capabilities... and then found that we needed
them to be somewhat recursive, allowing you to group low-level
commands together into more powerful highlevel commands).

Should be noted here that from my particular experience, writing
code that is undoable (i.e. filling in the execute()/undo() routines
for a given undoable command) is far more challenging than writing
a framework that supports it - but it would be great if a common
framework could at least be shared.

About GtkEntry... maybe it would be good to take a step back
and think MVC, GtkEntry usually effects some internal data in the
application - I'd much rather see built-in undoability implemented
in say, a GtkTextBuffer that might be viewed by multiple GtkEntries
or GtkTextViews... anyway just saying that usually you probably want
undo to effect the program's internal dataset, not the widgets that
are showing whatever happens to be current.

Cheers,
                   -Tristan





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