| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.GLib.Structs.MainLoop
Description
The GMainLoop struct is an opaque data type
representing the main event loop of a GLib or GTK application.
Synopsis
- newtype MainLoop = MainLoop (ManagedPtr MainLoop)
- mainLoopGetContext :: (HasCallStack, MonadIO m) => MainLoop -> m MainContext
- mainLoopIsRunning :: (HasCallStack, MonadIO m) => MainLoop -> m Bool
- mainLoopNew :: (HasCallStack, MonadIO m) => Maybe MainContext -> Bool -> m MainLoop
- mainLoopQuit :: (HasCallStack, MonadIO m) => MainLoop -> m ()
- mainLoopRef :: (HasCallStack, MonadIO m) => MainLoop -> m MainLoop
- mainLoopRun :: (HasCallStack, MonadIO m) => MainLoop -> m ()
- mainLoopUnref :: (HasCallStack, MonadIO m) => MainLoop -> m ()
Exported types
Memory-managed wrapper type.
Instances
| Eq MainLoop Source # | |
| GBoxed MainLoop Source # | |
Defined in GI.GLib.Structs.MainLoop | |
| ManagedPtrNewtype MainLoop Source # | |
Defined in GI.GLib.Structs.MainLoop Methods toManagedPtr :: MainLoop -> ManagedPtr MainLoop | |
| TypedObject MainLoop Source # | |
Defined in GI.GLib.Structs.MainLoop | |
| HasParentTypes MainLoop Source # | |
Defined in GI.GLib.Structs.MainLoop | |
| IsGValue (Maybe MainLoop) Source # | Convert |
Defined in GI.GLib.Structs.MainLoop Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe MainLoop -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe MainLoop) | |
| type ParentTypes MainLoop Source # | |
Defined in GI.GLib.Structs.MainLoop | |
Methods
Click to display all available methods, including inherited ones
getContext
Arguments
| :: (HasCallStack, MonadIO m) | |
| => MainLoop |
|
| -> m MainContext | Returns: the |
Returns the MainContext of loop.
isRunning
Arguments
| :: (HasCallStack, MonadIO m) | |
| => MainLoop |
|
| -> m Bool | Returns: |
Checks to see if the main loop is currently being run via mainLoopRun.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Maybe MainContext |
|
| -> Bool |
|
| -> m MainLoop | Returns: a new |
Creates a new MainLoop structure.
quit
Arguments
| :: (HasCallStack, MonadIO m) | |
| => MainLoop |
|
| -> m () |
Stops a MainLoop from running. Any calls to mainLoopRun
for the loop will return.
Note that sources that have already been dispatched when
mainLoopQuit is called will still be executed.
ref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => MainLoop |
|
| -> m MainLoop | Returns: |
Increases the reference count on a MainLoop object by one.
run
Arguments
| :: (HasCallStack, MonadIO m) | |
| => MainLoop |
|
| -> m () |
Runs a main loop until mainLoopQuit is called on the loop.
If this is called for the thread of the loop's MainContext,
it will process events from the loop, otherwise it will
simply wait.
unref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => MainLoop |
|
| -> m () |
Decreases the reference count on a MainLoop object by one. If
the result is zero, free the loop and free all associated memory.