Scene quit/time limit/callback feature would be nice
It would be very nice if you could put some sort of hook or functionality into Scene which allows for us to do any or all of the following:
- Limit how many frames it animates for (before hiding/exiting)
- Be able to trigger the stop/quit ourselves (so a draw(..) function could trigger it exiting, for some reason) - maybe a different return value or something from a method it calls for animating.
- Be able to pass a callback function as an argument that it would check every so often to see if it should continue running.
- Be able to raise a specific error type that would trigger Scene to quit, but would be captured by it - rather than triggering code to stop and highlight an error.
- Have a property on a scene object called .quit_now or something set to False - but when changed to a True value, trigger Scene to stop running.
Side note: Thanks for this project! I've been involved in Python for iOS (my name's in the credits as a special thanks) and just found your Pythonista interpreter and I've got to say - loving it so far!
My contributions to Python for iOS are here: https://github.com/pudquick/PythonForiOSPatches
The rest of my scripts are here: https://github.com/pudquick/ (as you can see - I like python, Macs, and iOS :))
Edit: Just noticed that someone has asked for this before - but I've put a few variations in my idea, maybe one of them would work? (and for the callback function, even if it was only called once every 2 or 3 seconds, that would be fine)