Implementing UNDO

Klaus major-k klaus at major-k.de
Sat May 22 13:54:38 EDT 2021


Hi Trevor,

> Am 22.05.2021 um 18:49 schrieb Trevor DeVore via use-livecode <use-livecode at lists.runrev.com>:
> ...
> 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

thanks for the hints, much appreciated!


Best

Klaus
--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
klaus at major-k.de





More information about the use-livecode mailing list