Menu

#172 Ask a text widget for the depth of its undo and redo stacks

open
18. [text] (18)
5
2005-08-25
2005-08-25
No

I would like to have a way to query the current depth of
the undo and redo stacks of a text widget.

This would allow to enable/disable contextually Undo
and Redo commands in applications.

Whether the undo stack is empty or not can be known
by querying the modified flag (although this is not
equivalent, but I can set the modified flag manually in
such a way that it is).

I have however no solution for the redo stack depth. How
can I know if it's zero or not? Currently I have to track
manually any editing in my text widget, this is
cumbersome and greatly lowers the interest of using the
embedded .text edit commands.

In summary please add a command that gives the
current depth of each stack, or at least a command that
says if the depths are zero or not.

Thanks,
Francois

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.