Thanks, Jonathon. Regards, Arthur
2007/2/5, Jonathon Jongsma <[EMAIL PROTECTED]>:
On 2/5/07, Arthur Maciel <[EMAIL PROTECTED]> wrote: > Thanks, > Bernib. > > But if the user cuts some selection from a treeview and set the focus to > another treeview, when he undo'es, how could I know where the cut > information belongs to? > > Regards, > Arthur Generally, undo/redo functionality is done with two stacks: an undo stack and a redo stack. each stack holds a list of objects that describe the action that can be undone (or re-done). When the user clicks the 'undo' button, you pop the top item off the undo stack, perform the action, and push it onto the redo stack. You'd have to store enough information to make the action reversible. Generally this is application specific, so it's going to be different for each application. For example, you might create a UndoableAction class that stores the action type, maybe a pointer to the widget that the action was applied to, and any other data necessary to re-do the action. So in the specific case you describe, you might create an UndoableAction object with a "REMOVE" action, applied to TreeViewA, with data xyz. Anyway, those are just some ideas off the top of my head. There are probably better ways to do the UndoableAction than the simplistic implementation I mentioned above. You could do a google search for something like "undo manager" to get more inspiration. Hope that helps. -- jonner
_______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
