hob-0.0.1.0: src/lib/Hob/Control.hs
module Hob.Control (
maybeDo,
flushEvents
) where
import Control.Monad (when)
import Graphics.UI.Gtk (eventsPending, mainIteration)
maybeDo :: Monad b => (a -> b ()) -> Maybe a -> b ()
maybeDo = maybe (return())
flushEvents :: IO()
flushEvents = do
pending <- eventsPending
when (pending > 0) $ mainIteration >> flushEvents