Undo an action - HELP

Hey everyone!
I am making an app (Drawing) where I want to put an Undo Button. I am unable to figure out how to do that or if there is any way to make an undo button.

Please help me. If Undo Button is not possible, please provide me with some alternatives.
Note- I am ready to use extensions, if any.

A way to create an undo button is to periodically save temporarily the photo the user is drawing and once the undo button is pressed you set that image as the canvas background. Something like that. Sorry if I didn’t explain it well.

1 Like

No that’s okay. You explained well.

Thank You for the idea. But can you provide me with the blocks (example). It will be more efficient because if after each stroke the photo is saved, then the storage will end up (probably).

1 Like

I can’t use the builder right now in order to give you an example with blocks.

But to solve the storage issue you’ll have to give the ability to the user to undo only a small number of steps behind (6-7 for example).
So basically when you create a “checkpoint” of the photo being edited, store it’s name in tinyDB. When the limit of checkpoints is reached (when there are 6 photos already saved) and you want to create one more, delete the oldest of the 6 photos. That’s the philosophy behind it:)

Thanks a lot

1 Like

No problem :slight_smile: It needs a bit of thinking to see how exactly you’ll have to arrange your blocks for this to work (I haven’t done it before. I just thought about it) But it’s possible :wink:

see this example project https://groups.google.com/d/msg/app-inventor-developers-library/yF2Auslt82M/e-9D1gSIS78J
Taifun

3 Likes