I'm still getting into some of the more advanced features of pythonista...and I was wondering what was legal/illegal in the ui.animate() function.
How does it work, exactly? Underneath the hood, is it creating an objective-C block to call in some other thread from the UI and main threads? If so, is it legal to call draw() from within a method on a widget which is called from animate()?
So if I have a setup like:
class MyWidget(ui.View):
...
def animatedDrawAction(self, sender):
def _draw():
...set some internal state while animated...
self.draw() # redraw to reflect that new state
ui.animate(_draw, 1.0)
is that allowed? Or is calling draw() going to do bad things if it isn't within the main thread? Should I instead call set_needs_display() within the animation and the UI thread will hopefully update as the animation runs?
Or am I completely missing the point here?