From 08e525e2de0fe667635204f6a6ef5d9e4f374772 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 2 Mar 2019 21:34:46 -0500 Subject: [PATCH] more stuff --- simpledisplay.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simpledisplay.d b/simpledisplay.d index e6e5585..04c35d3 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -2662,10 +2662,13 @@ static struct GenericCursor { struct EventLoop { @disable this(); + /// Gets a reference to an existing event loop static EventLoop get() { return EventLoop(0, null); } + /// Construct an application-global event loop for yourself + /// See_Also: [SimpleWindow.setEventHandlers] this(long pulseTimeout, void delegate() handlePulse) { if(impl is null) impl = new EventLoopImpl(pulseTimeout, handlePulse); @@ -2693,12 +2696,14 @@ struct EventLoop { impl.refcount++; } + /// Runs the event loop until the whileCondition, if present, returns false int run(bool delegate() whileCondition = null) { assert(impl !is null); impl.notExited = true; return impl.run(whileCondition); } + /// Exits the event loop void exit() { assert(impl !is null); impl.notExited = false;