Copyright | Sven Bartscher 2020 |
---|---|
License | MPL-2.0 |
Maintainer | sven.bartscher@weltraumschlangen.de |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class MonadIO m => MonadRunGtk m where
Documentation
class MonadIO m => MonadRunGtk m where Source #
Typeclass for Monad
s that give the ability to run IO actions in
the proper context for calling GTK functions. Most notably, this
means that the IO action is run in the thread that GTK was
initialized in.
runGtk :: IO a -> m a Source #
Execute the given IO
action in the correct context for
calling GTK actions. This might mean executing the action in a
different thread if the current thread is not the GTK thread, but
it might also mean executing the action in the current thread if
the current thread is the GTK thread.
runGtk_ :: IO a -> m () Source #
Like runGtk
but does not return the result of the executed
action and will not wait for the action to finish executing if it
is run in a different thread.
Note that it is not precisely specified under which circumstances
will be executed asynchronously in a different thread or
synchronously in the current thread, so you should either account
for both possibilities or use runGtk
to always wait
synchronously wait for the action to finish.
runGtkPromise :: IO a -> m (m a) Source #
Like runGtk
but does not wait for the IO
action to finish
executing. Instead it returns another monadic action that waits
for the action to finish and returns its result.
Note that just as with runGtk_
it is not exactly specified
under which circumstances the action will be run asynchronously
or synchronously. You should either account for both cases or use
runGtk
to always wait for the action to finish.
Instances
MonadRunGtk m => MonadRunGtk (ReaderT r m) Source # | |
MonadRunGtk m => MonadRunGtk (PostBuildT t m) Source # | |
Defined in Reflex.GI.Gtk.Run.Class runGtk :: IO a -> PostBuildT t m a Source # runGtk_ :: IO a -> PostBuildT t m () Source # runGtkPromise :: IO a -> PostBuildT t m (PostBuildT t m a) Source # | |
MonadRunGtk m => MonadRunGtk (TriggerEventT t m) Source # | |
Defined in Reflex.GI.Gtk.Run.Class runGtk :: IO a -> TriggerEventT t m a Source # runGtk_ :: IO a -> TriggerEventT t m () Source # runGtkPromise :: IO a -> TriggerEventT t m (TriggerEventT t m a) Source # | |
(ReflexHost t, MonadIO (HostFrame t)) => MonadRunGtk (ReflexGtkT t m) Source # | |
Defined in Reflex.GI.Gtk.Host runGtk :: IO a -> ReflexGtkT t m a Source # runGtk_ :: IO a -> ReflexGtkT t m () Source # runGtkPromise :: IO a -> ReflexGtkT t m (ReflexGtkT t m a) Source # |