Implementing UNDO

Trevor DeVore lists at mangomultimedia.com
Sat May 22 12:49:00 EDT 2021


On Fri, May 21, 2021 at 3:11 PM Mike Kerner via use-livecode <
use-livecode at lists.runrev.com> wrote:

> fyi, for posterity, here is the link to the wiki for levure's undo manager
> helper
> https://github.com/trevordevore/levure/wiki/helper-undo_manager


Here is a link to the code:

https://github.com/trevordevore/levure/tree/develop/framework/helpers/undo_manager

This should be easy enough to add to any app. I just checked the code and
there are no calls to any functions or commands in the Levure framework
itself. If you look at the helper.yml file you see this:

```
libraries:
  - filename: undoManager.livecodescript
frontscripts:
  - filename: field_edits_undo.livecodescript
    autoload: false
```

What that means is that you should `start using stack
"undoManager.livecodescript"` when your app starts up and `put there is a
stack "field_edits_undo.livecodescript" into tStackIsNoInMemory`. (Note
that it is left as an exercise to the reader to determine the full path to
those stacks when being used in your app.) The
`field_edits_undo.livecodescript` stack just needs to be in memory so that
`undoManager.livecodescript` can insert it into the front whenever the user
is editing text in a field.

-- 
Trevor DeVore
ScreenSteps
www.screensteps.com



More information about the use-livecode mailing list