◐ Shell
clean mode source ↗

[ENH]: Start Animation in a paused state

Problem

Currently when creating an animation, the event source is started by a callback that runs Animation._start() during the first 'draw_event'. This prevents any attempt of starting an animation in a paused state short of tampering with private parts of the API. Additionally, the user should be able to query the state of the event source. The EventSourceProtocol has no method that returns if it has been started or stopped.

Proposed solution

Instead the constructor could specify with a keyword argument if the animation should start in a paused state or not. That boolean could then be used to guard the call to event_source.start() which could be called later in a callback provided by the user. Additionally a method that returns a boolean should be added to all event sources and the EventSourceProtcol that returns if it is stopped or started.