diff options
author | Camil Staps | 2020-01-30 09:36:43 +0100 |
---|---|---|
committer | Camil Staps | 2020-01-30 09:36:43 +0100 |
commit | 52a64f70b45e8a10c4a3480f55f6ec6dd7ce1de6 (patch) | |
tree | 4a8dd74f5785c1e2ffda0bec3ada43ab59b7bc11 | |
parent | Add support for populate-popup signal (diff) |
-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 |