diff options
-rw-r--r-- | src/Gtk/State.icl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Gtk/State.icl b/src/Gtk/State.icl index 32c2b19..fde5cf0 100644 --- a/src/Gtk/State.icl +++ b/src/Gtk/State.icl @@ -109,10 +109,12 @@ quit :: GtkM () quit = modState (\st -> {st & return=True}) >>| pure () runWhileEventsPending :: GtkM () -runWhileEventsPending = - toStateR gtk_events_pending >>= \pending - | not pending -> - pure () - | otherwise -> - toStateR gtk_main_iteration >>| - runWhileEventsPending +runWhileEventsPending = withPossibleCallback run +where + run = + toStateR gtk_events_pending >>= \pending + | not pending -> + pure () + | otherwise -> + toStateR gtk_main_iteration >>| + run |