/usr/share/doc/libghc-gtk3-doc/html/Graphics-UI-Gtk-General-General.html is in libghc-gtk3-doc 0.14.8-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Graphics.UI.Gtk.General.General</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Graphics-UI-Gtk-General-General.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Graphics-UI-Gtk-General-General.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">gtk3-0.14.8: Binding to the Gtk+ 3 graphical user interface library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Maintainer</th><td>gtk2hs-users@lists.sourceforge.net</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>portable (depends on GHC)</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Graphics.UI.Gtk.General.General</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Initialisation</a><ul><li><a href="#g:2">Support for OS threads</a></li></ul></li><li><a href="#g:3">Main event loop</a><ul><li><a href="#g:4">Less commonly used event loop functions</a></li><li><a href="#g:5">Call when mainloop is left</a></li></ul></li><li><a href="#g:6">Grab widgets</a></li><li><a href="#g:7">Timeout and idle callbacks</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>library initialization, main event loop, and events</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:initGUI">initGUI</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:unsafeInitGUIForThreadedRTS">unsafeInitGUIForThreadedRTS</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:postGUISync">postGUISync</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:postGUIAsync">postGUIAsync</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:threadsEnter">threadsEnter</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:threadsLeave">threadsLeave</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:mainGUI">mainGUI</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:mainQuit">mainQuit</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:eventsPending">eventsPending</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:mainLevel">mainLevel</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:mainIteration">mainIteration</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:mainIterationDo">mainIterationDo</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:mainDoEvent">mainDoEvent</a> :: <a href="Graphics-UI-Gtk-Gdk-EventM.html#t:EventM">EventM</a> t ()</li><li class="src short"><a href="#v:grabAdd">grabAdd</a> :: <a href="Graphics-UI-Gtk-Abstract-Widget.html#t:WidgetClass">WidgetClass</a> wd => wd -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:grabGetCurrent">grabGetCurrent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Graphics-UI-Gtk-Abstract-Widget.html#t:Widget">Widget</a>)</li><li class="src short"><a href="#v:grabRemove">grabRemove</a> :: <a href="Graphics-UI-Gtk-Abstract-Widget.html#t:WidgetClass">WidgetClass</a> w => w -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><span class="keyword">type</span> <a href="#t:Priority">Priority</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:priorityLow">priorityLow</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:priorityDefaultIdle">priorityDefaultIdle</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:priorityHighIdle">priorityHighIdle</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:priorityDefault">priorityDefault</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:priorityHigh">priorityHigh</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:timeoutAdd">timeoutAdd</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a></li><li class="src short"><a href="#v:timeoutAddFull">timeoutAddFull</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:Priority">Priority</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a></li><li class="src short"><a href="#v:timeoutRemove">timeoutRemove</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:idleAdd">idleAdd</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:Priority">Priority</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a></li><li class="src short"><a href="#v:idleRemove">idleRemove</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:inputAdd">inputAdd</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:FD">FD</a> -> [<a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a>] -> <a href="Graphics-UI-Gtk-General-General.html#t:Priority">Priority</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a></li><li class="src short"><a href="#v:inputRemove">inputRemove</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><span class="keyword">data</span> <a href="#t:IOCondition">IOCondition</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Kind.html#t:-42-">*</a><ul class="subs"><li>= <a href="#v:IOIn">IOIn</a></li><li>| <a href="#v:IOOut">IOOut</a></li><li>| <a href="#v:IOPri">IOPri</a></li><li>| <a href="#v:IOErr">IOErr</a></li><li>| <a href="#v:IOHup">IOHup</a></li><li>| <a href="#v:IOInvalid">IOInvalid</a></li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:HandlerId">HandlerId</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Foreign-C-Types.html#t:CUInt">CUInt</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:FD">FD</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li></ul></div><div id="interface"><h1 id="g:1">Initialisation</h1><div class="top"><p class="src"><a id="v:initGUI" class="def">initGUI</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>] <a href="src/Graphics-UI-Gtk-General-General.html#initGUI" class="link">Source</a> <a href="#v:initGUI" class="selflink">#</a></p><div class="doc"><p>Initialize the GUI.</p><p>This must be called before any other function in the Gtk2Hs library.</p><p>This function initializes the GUI toolkit and parses all Gtk
specific arguments. The remaining arguments are returned. If the
initialization of the toolkit fails for whatever reason, an exception
is thrown.</p><ul><li>Throws: <code>error "Cannot initialize GUI."</code></li><li>If you want to use Gtk2Hs and in a multi-threaded application then it is your obligation
to ensure that all calls to Gtk+ happen in a single OS thread.
If you want to make calls to Gtk2Hs functions from a Haskell thread other
than the one that calls this functions and <code><a href="Graphics-UI-Gtk-General-General.html#v:mainGUI">mainGUI</a></code> then you will have to
'post' your GUI actions to the main GUI thread. You can do this using
<code><a href="Graphics-UI-Gtk-General-General.html#v:postGUISync">postGUISync</a></code> or <code><a href="Graphics-UI-Gtk-General-General.html#v:postGUIAsync">postGUIAsync</a></code>. See also <code><a href="Graphics-UI-Gtk-General-General.html#v:threadsEnter">threadsEnter</a></code>.</li></ul></div></div><h2 id="g:2">Support for OS threads</h2><div class="top"><p class="src"><a id="v:unsafeInitGUIForThreadedRTS" class="def">unsafeInitGUIForThreadedRTS</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>] <a href="src/Graphics-UI-Gtk-General-General.html#unsafeInitGUIForThreadedRTS" class="link">Source</a> <a href="#v:unsafeInitGUIForThreadedRTS" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:postGUISync" class="def">postGUISync</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a <a href="src/Graphics-UI-Gtk-General-General.html#postGUISync" class="link">Source</a> <a href="#v:postGUISync" class="selflink">#</a></p><div class="doc"><p>Post an action to be run in the main GUI thread.</p><p>The current thread blocks until the action completes and the result is
returned.</p></div></div><div class="top"><p class="src"><a id="v:postGUIAsync" class="def">postGUIAsync</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Graphics-UI-Gtk-General-General.html#postGUIAsync" class="link">Source</a> <a href="#v:postGUIAsync" class="selflink">#</a></p><div class="doc"><p>Post an action to be run in the main GUI thread.</p><p>The current thread continues and does not wait for the result of the
action.</p></div></div><div class="top"><p class="src"><a id="v:threadsEnter" class="def">threadsEnter</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Graphics-UI-Gtk-General-General.html#threadsEnter" class="link">Source</a> <a href="#v:threadsEnter" class="selflink">#</a></p><div class="doc"><p>Acquire the global Gtk lock.</p><ul><li>During normal operation, this lock is held by the thread from which all
interaction with Gtk is performed. When calling <code><a href="Graphics-UI-Gtk-General-General.html#v:mainGUI">mainGUI</a></code>, the thread will
release this global lock before it waits for user interaction. During this
time it is, in principle, possible to use a different OS thread (any other
Haskell thread that is bound to the Gtk OS thread will be blocked anyway)
to interact with Gtk by explicitly acquiring the lock, calling Gtk functions
and releasing the lock. However, the Gtk functions that are called from this
different thread may not trigger any calls to the OS since this will
lead to a crash on Windows (the Win32 API can only be used from a single
thread). Since it is very hard to tell which function only interacts on
Gtk data structures and which function call actual OS functions, it
is best not to use this feature at all. A better way to perform updates
in the background is to spawn a Haskell thread and to perform the update
to Gtk widgets using <code><a href="Graphics-UI-Gtk-General-General.html#v:postGUIAsync">postGUIAsync</a></code> or <code><a href="Graphics-UI-Gtk-General-General.html#v:postGUISync">postGUISync</a></code>. These will execute
their arguments from the main loop, that is, from the OS thread of Gtk,
thereby ensuring that any Gtk and OS function can be called.</li></ul></div></div><div class="top"><p class="src"><a id="v:threadsLeave" class="def">threadsLeave</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Graphics-UI-Gtk-General-General.html#threadsLeave" class="link">Source</a> <a href="#v:threadsLeave" class="selflink">#</a></p><div class="doc"><p>Release the global Gtk lock.</p><ul><li>The use of this function is not recommended. See <code><a href="Graphics-UI-Gtk-General-General.html#v:threadsEnter">threadsEnter</a></code>.</li></ul></div></div><h1 id="g:3">Main event loop</h1><div class="top"><p class="src"><a id="v:mainGUI" class="def">mainGUI</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Graphics-UI-Gtk-General-General.html#mainGUI" class="link">Source</a> <a href="#v:mainGUI" class="selflink">#</a></p><div class="doc"><p>Run the Gtk+ main event loop.</p></div></div><div class="top"><p class="src"><a id="v:mainQuit" class="def">mainQuit</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Graphics-UI-Gtk-General-General.html#mainQuit" class="link">Source</a> <a href="#v:mainQuit" class="selflink">#</a></p><div class="doc"><p>Exit the main event loop.</p></div></div><h2 id="g:4">Less commonly used event loop functions</h2><div class="top"><p class="src"><a id="v:eventsPending" class="def">eventsPending</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Graphics-UI-Gtk-General-General.html#eventsPending" class="link">Source</a> <a href="#v:eventsPending" class="selflink">#</a></p><div class="doc"><p>Inquire the number of events pending on the event queue</p></div></div><div class="top"><p class="src"><a id="v:mainLevel" class="def">mainLevel</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Graphics-UI-Gtk-General-General.html#mainLevel" class="link">Source</a> <a href="#v:mainLevel" class="selflink">#</a></p><div class="doc"><p>Inquire the main loop level.</p><ul><li>Callbacks that take more time to process can call <code><a href="Graphics-UI-Gtk-General-General.html#v:mainIteration">mainIteration</a></code> to keep
the GUI responsive. Each time the main loop is restarted this way, the main
loop counter is increased. This function returns this counter.</li></ul></div></div><div class="top"><p class="src"><a id="v:mainIteration" class="def">mainIteration</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Graphics-UI-Gtk-General-General.html#mainIteration" class="link">Source</a> <a href="#v:mainIteration" class="selflink">#</a></p><div class="doc"><p>Process an event, block if necessary.</p><ul><li>Returns <code>True</code> if <code><a href="Graphics-UI-Gtk-General-General.html#v:mainQuit">mainQuit</a></code> was called while processing the event.</li></ul></div></div><div class="top"><p class="src"><a id="v:mainIterationDo" class="def">mainIterationDo</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Graphics-UI-Gtk-General-General.html#mainIterationDo" class="link">Source</a> <a href="#v:mainIterationDo" class="selflink">#</a></p><div class="doc"><p>Process a single event.</p><ul><li>Called with <code>True</code>, this function behaves as <code><a href="Graphics-UI-Gtk-General-General.html#v:mainIteration">mainIteration</a></code> in that it
waits until an event is available for processing. It will return
immediately, if passed <code>False</code>.</li><li>Returns <code>True</code> if the <code><a href="Graphics-UI-Gtk-General-General.html#v:mainQuit">mainQuit</a></code> was called while processing the event.</li></ul></div></div><div class="top"><p class="src"><a id="v:mainDoEvent" class="def">mainDoEvent</a> :: <a href="Graphics-UI-Gtk-Gdk-EventM.html#t:EventM">EventM</a> t () <a href="src/Graphics-UI-Gtk-General-General.html#mainDoEvent" class="link">Source</a> <a href="#v:mainDoEvent" class="selflink">#</a></p><div class="doc"><p>Processes a single GDK event. This is public only to allow filtering of events between GDK and
GTK+. You will not usually need to call this function directly.</p><p>While you should not call this function directly, you might want to know how exactly events are
handled. So here is what this function does with the event:</p><ol><li>Compress enter/leave notify events. If the event passed build an enter/leave pair together with
the next event (peeked from GDK) both events are thrown away. This is to avoid a backlog of
(de-)highlighting widgets crossed by the pointer.</li><li>Find the widget which got the event. If the widget can't be determined the event is thrown away
unless it belongs to a INCR transaction. In that case it is passed to
<code>selectionIncrEvent</code>.</li><li>Then the event is passed on a stack so you can query the currently handled event with
<code>getCurrentEvent</code>.</li><li>The event is sent to a widget. If a grab is active all events for widgets that are not in the
contained in the grab widget are sent to the latter with a few exceptions:</li></ol><ul><li>Deletion and destruction events are still sent to the event widget for obvious reasons.</li><li>Events which directly relate to the visual representation of the event widget.</li><li>Leave events are delivered to the event widget if there was an enter event delivered to it
before without the paired leave event.</li><li>Drag events are not redirected because it is unclear what the semantics of that would be.</li></ul><p>Another point of interest might be that all key events are first passed through the key snooper
functions if there are any. Read the description of <code>keySnooperInstall</code> if you need this
feature.</p><ol><li>After finishing the delivery the event is popped from the event stack.</li></ol></div></div><h2 id="g:5">Call when mainloop is left</h2><h1 id="g:6">Grab widgets</h1><div class="top"><p class="src"><a id="v:grabAdd" class="def">grabAdd</a> :: <a href="Graphics-UI-Gtk-Abstract-Widget.html#t:WidgetClass">WidgetClass</a> wd => wd -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Graphics-UI-Gtk-General-General.html#grabAdd" class="link">Source</a> <a href="#v:grabAdd" class="selflink">#</a></p><div class="doc"><p>add a grab widget</p></div></div><div class="top"><p class="src"><a id="v:grabGetCurrent" class="def">grabGetCurrent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Graphics-UI-Gtk-Abstract-Widget.html#t:Widget">Widget</a>) <a href="src/Graphics-UI-Gtk-General-General.html#grabGetCurrent" class="link">Source</a> <a href="#v:grabGetCurrent" class="selflink">#</a></p><div class="doc"><p>inquire current grab widget</p></div></div><div class="top"><p class="src"><a id="v:grabRemove" class="def">grabRemove</a> :: <a href="Graphics-UI-Gtk-Abstract-Widget.html#t:WidgetClass">WidgetClass</a> w => w -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Graphics-UI-Gtk-General-General.html#grabRemove" class="link">Source</a> <a href="#v:grabRemove" class="selflink">#</a></p><div class="doc"><p>remove a grab widget</p></div></div><h1 id="g:7">Timeout and idle callbacks</h1><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Priority" class="def">Priority</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="#t:Priority" class="selflink">#</a></p><div class="doc"><p>Priorities for installing callbacks.</p></div></div><div class="top"><p class="src"><a id="v:priorityLow" class="def">priorityLow</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="#v:priorityLow" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:priorityDefaultIdle" class="def">priorityDefaultIdle</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="#v:priorityDefaultIdle" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:priorityHighIdle" class="def">priorityHighIdle</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="#v:priorityHighIdle" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:priorityDefault" class="def">priorityDefault</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="#v:priorityDefault" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:priorityHigh" class="def">priorityHigh</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="#v:priorityHigh" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:timeoutAdd" class="def">timeoutAdd</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> <a href="src/Graphics-UI-Gtk-General-General.html#timeoutAdd" class="link">Source</a> <a href="#v:timeoutAdd" class="selflink">#</a></p><div class="doc"><p>Sets a function to be called at regular intervals, with the default
priority <code><a href="Graphics-UI-Gtk-General-General.html#v:priorityDefault">priorityDefault</a></code>. The function is called repeatedly until it
returns <code>False</code>, after which point the timeout function will not be called
again. The first call to the function will be at the end of the first interval.</p><p>Note that timeout functions may be delayed, due to the processing of other
event sources. Thus they should not be relied on for precise timing. After
each call to the timeout function, the time of the next timeout is
recalculated based on the current time and the given interval (it does not
try to 'catch up' time lost in delays).</p><p>This function differs from <code><a href="file:///usr/share/doc/libghc-glib-doc/html/System-Glib-MainLoop.html#v:timeoutAdd">timeoutAdd</a></code> in that the action will
be executed within the global Gtk+ lock. It is therefore possible to
call Gtk+ functions from the action.</p></div></div><div class="top"><p class="src"><a id="v:timeoutAddFull" class="def">timeoutAddFull</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:Priority">Priority</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> <a href="src/Graphics-UI-Gtk-General-General.html#timeoutAddFull" class="link">Source</a> <a href="#v:timeoutAddFull" class="selflink">#</a></p><div class="doc"><p>Sets a function to be called at regular intervals, with the given
priority. The function is called repeatedly until it returns <code>False</code>, after
which point the timeout function will not be called again. The first call
to the function will be at the end of the first interval.</p><p>Note that timeout functions may be delayed, due to the processing of other
event sources. Thus they should not be relied on for precise timing. After
each call to the timeout function, the time of the next timeout is
recalculated based on the current time and the given interval (it does not
try to 'catch up' time lost in delays).</p><p>This function differs from <code><a href="file:///usr/share/doc/libghc-glib-doc/html/System-Glib-MainLoop.html#v:timeoutAddFull">timeoutAddFull</a></code> in that the action will
be executed within the global Gtk+ lock. It is therefore possible to
call Gtk+ functions from the action.</p></div></div><div class="top"><p class="src"><a id="v:timeoutRemove" class="def">timeoutRemove</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="#v:timeoutRemove" class="selflink">#</a></p><div class="doc"><p>Remove a previously added timeout handler by its <code><a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:idleAdd" class="def">idleAdd</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:Priority">Priority</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> <a href="src/Graphics-UI-Gtk-General-General.html#idleAdd" class="link">Source</a> <a href="#v:idleAdd" class="selflink">#</a></p><div class="doc"><p>Add a callback that is called whenever the system is idle.</p><ul><li>A priority can be specified via an integer. This should usually be
<code><a href="Graphics-UI-Gtk-General-General.html#v:priorityDefaultIdle">priorityDefaultIdle</a></code>.</li><li>If the function returns <code>False</code> it will be removed.</li></ul><p>This function differs from <code><a href="file:///usr/share/doc/libghc-glib-doc/html/System-Glib-MainLoop.html#v:idleAdd">idleAdd</a></code> in that the action will
be executed within the global Gtk+ lock. It is therefore possible to
call Gtk+ functions from the action.</p></div></div><div class="top"><p class="src"><a id="v:idleRemove" class="def">idleRemove</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="#v:idleRemove" class="selflink">#</a></p><div class="doc"><p>Remove a previously added idle handler by its <code><a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:inputAdd" class="def">inputAdd</a> <a href="src/Graphics-UI-Gtk-General-General.html#inputAdd" class="link">Source</a> <a href="#v:inputAdd" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-General.html#t:FD">FD</a></td><td class="doc"><p>a file descriptor</p></td></tr><tr><td class="src">-> [<a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a>]</td><td class="doc"><p>the condition to watch for</p></td></tr><tr><td class="src">-> <a href="Graphics-UI-Gtk-General-General.html#t:Priority">Priority</a></td><td class="doc"><p>the priority of the event source</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>the function to call when the condition is satisfied.
The function should return False if the event source
should be removed.</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a></td><td class="doc"><p>the event source id</p></td></tr></table></div><div class="doc"><p>Adds the file descriptor into the main event loop with the given priority.</p><p>This function differs from <code><a href="file:///usr/share/doc/libghc-glib-doc/html/System-Glib-MainLoop.html#v:inputAdd">inputAdd</a></code> in that the action will
be executed within the global Gtk+ lock. It is therefore possible to
call Gtk+ functions from the action.</p></div></div><div class="top"><p class="src"><a id="v:inputRemove" class="def">inputRemove</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:HandlerId">HandlerId</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="#v:inputRemove" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:IOCondition" class="def">IOCondition</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Kind.html#t:-42-">*</a> <a href="#t:IOCondition" class="selflink">#</a></p><div class="doc"><p>Flags representing a condition to watch for on a file descriptor.</p><dl><dt><code>IOIn</code></dt><dd>There is data to read.</dd><dt><code>IOOut</code></dt><dd>Data can be written (without blocking).</dd><dt><code>IOPri</code></dt><dd>There is urgent data to read.</dd><dt><code>IOErr</code></dt><dd>Error condition.</dd><dt><code>IOHup</code></dt><dd>Hung up (the connection has been broken, usually for
pipes and sockets).</dd><dt><code>IOInvalid</code></dt><dd>Invalid request. The file descriptor is not open.</dd></dl></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:IOIn" class="def">IOIn</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:IOOut" class="def">IOOut</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:IOPri" class="def">IOPri</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:IOErr" class="def">IOErr</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:IOHup" class="def">IOHup</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:IOInvalid" class="def">IOInvalid</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:IOCondition" class="caption collapser" onclick="toggleSection('i:IOCondition')">Instances</p><div id="section.i:IOCondition" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IOCondition:Bounded:1" class="instance expander" onclick="toggleSection('i:id:IOCondition:Bounded:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Bounded">Bounded</a> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:IOCondition:Bounded:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:minBound">minBound</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> <a href="#v:minBound" class="selflink">#</a></p><p class="src"><a href="#v:maxBound">maxBound</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> <a href="#v:maxBound" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IOCondition:Enum:2" class="instance expander" onclick="toggleSection('i:id:IOCondition:Enum:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Enum">Enum</a> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:IOCondition:Enum:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:succ">succ</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> <a href="#v:succ" class="selflink">#</a></p><p class="src"><a href="#v:pred">pred</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> <a href="#v:pred" class="selflink">#</a></p><p class="src"><a href="#v:toEnum">toEnum</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> <a href="#v:toEnum" class="selflink">#</a></p><p class="src"><a href="#v:fromEnum">fromEnum</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="#v:fromEnum" class="selflink">#</a></p><p class="src"><a href="#v:enumFrom">enumFrom</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> [<a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a>] <a href="#v:enumFrom" class="selflink">#</a></p><p class="src"><a href="#v:enumFromThen">enumFromThen</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> [<a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a>] <a href="#v:enumFromThen" class="selflink">#</a></p><p class="src"><a href="#v:enumFromTo">enumFromTo</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> [<a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a>] <a href="#v:enumFromTo" class="selflink">#</a></p><p class="src"><a href="#v:enumFromThenTo">enumFromThenTo</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> [<a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a>] <a href="#v:enumFromThenTo" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IOCondition:Eq:3" class="instance expander" onclick="toggleSection('i:id:IOCondition:Eq:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:IOCondition:Eq:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IOCondition:Flags:4" class="instance expander" onclick="toggleSection('i:id:IOCondition:Flags:4')"></span> <a href="file:///usr/share/doc/libghc-glib-doc/html/System-Glib-Flags.html#t:Flags">Flags</a> <a href="Graphics-UI-Gtk-General-General.html#t:IOCondition">IOCondition</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:IOCondition:Flags:4" class="inst-details hide"></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:HandlerId" class="def">HandlerId</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Foreign-C-Types.html#t:CUInt">CUInt</a> <a href="#t:HandlerId" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:FD" class="def">FD</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Graphics-UI-Gtk-General-General.html#FD" class="link">Source</a> <a href="#t:FD" class="selflink">#</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|