jupyter-widgets-contrib / ipycanvas

Interactive Canvas in Jupyter
https://ipycanvas.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
685 stars 62 forks source link

any way to pause animation? #331

Closed bhomass closed 1 year ago

bhomass commented 1 year ago

Once the animation loop starts, there seems to be no way to pause it. I have button for setting a global pause flag, but the loop will run to the end before the flag gets set.

martinRenou commented 1 year ago

Thanks for opening an issue. The animation code is fully on your side, ipycanvas provides no mean to do animation, so you'll need to update your code to be able to pause your animation.

If you could share your for-loop code of your animation I could probably help.

bhomass commented 1 year ago

I found a way to do this using threads. Thanks