[plt-scheme] hooking add-to-undo-stack

From: Martin DeMello (martindemello at gmail.com)
Date: Mon Apr 27 03:56:04 EDT 2009

My app has a lot of editors embedded in a pasteboard, and I would like
undo and redo to be global operations rather than per-editor. What
I've done is added an undo and redo stack to my application% object,
and methods add-undo, undo and redo. The idea is that when something
changes in an editor, it will call (send application add-undo this),
and calling undo will call (send (pop-undo-stack) undo). Is there any
way to get a callback when something is added to an editor's undo
stack, so that I can call add-undo? on-change is the closest I could
find, but from the docs that also pulls in non-editing events like
resizing and reflowing.


Posted on the users mailing list.