On Monday, 25 February 2019 at 22:34:54 UTC, Murilo wrote:
Hi Adam. I am using your library. There is the ScreenPainter
struct and it has a method called .eventLoop(), how do I make
it stop after a certain amount of loops? I would like to be
able to call it several times in the program.
I fear your program is poorly designed, that kind of thing
shouldn't be necessary.
But it is possible by using the EventLoop struct directly.
http://dpldocs.info/experimental-docs/arsd.simpledisplay.EventLoop.html
EventLoop.get.exit() will exit the loop, though it may not want
to start up again (I have never tried).
You can also do something like, after setting it all up,
bool done;
EventLoop el = EventLoop.get;
el.run(() { return !done; });
And that delegate you pass to `run` tells it when to return.