<!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.Gdk.Gdk</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_Graphics-UI-Gtk-Gdk-Gdk.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Graphics-UI-Gtk-Gdk-Gdk.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">gtk-0.12.0: Binding to the Gtk+ graphical user interface library.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable (depends on GHC)</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>gtk2hs-users@lists.sourceforge.net</td></tr></table><p class="caption">Graphics.UI.Gtk.Gdk.Gdk</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Gdk general functions. </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:flush">flush</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:screenWidth">screenWidth</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:screenHeight">screenHeight</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:screenWidthMM">screenWidthMM</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:screenHeightMM">screenHeightMM</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:GrabStatus">GrabStatus</a> <ul class="subs"><li>= <a href="#v:GrabSuccess">GrabSuccess</a> </li><li>| <a href="#v:GrabAlreadyGrabbed">GrabAlreadyGrabbed</a> </li><li>| <a href="#v:GrabInvalidTime">GrabInvalidTime</a> </li><li>| <a href="#v:GrabNotViewable">GrabNotViewable</a> </li><li>| <a href="#v:GrabFrozen">GrabFrozen</a> </li></ul></li><li class="src short"><a href="#v:pointerGrab">pointerGrab</a> :: (<a href="Graphics-UI-Gtk-Gdk-DrawWindow.html#t:DrawWindowClass">DrawWindowClass</a> window, <a href="Graphics-UI-Gtk-Gdk-DrawWindow.html#t:DrawWindowClass">DrawWindowClass</a> confine_to) => window -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a> -> [<a href="Graphics-UI-Gtk-General-Enums.html#t:EventMask">EventMask</a>] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> confine_to -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Graphics-UI-Gtk-Gdk-Cursor.html#t:Cursor">Cursor</a> -> <a href="Graphics-UI-Gtk-Gdk-Events.html#t:TimeStamp">TimeStamp</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-Gdk-Gdk.html#t:GrabStatus">GrabStatus</a></li><li class="src short"><a href="#v:pointerUngrab">pointerUngrab</a> :: <a href="Graphics-UI-Gtk-Gdk-Events.html#t:TimeStamp">TimeStamp</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:pointerIsGrabbed">pointerIsGrabbed</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:keyboardGrab">keyboardGrab</a> :: <a href="Graphics-UI-Gtk-Gdk-DrawWindow.html#t:DrawWindowClass">DrawWindowClass</a> window => window -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Graphics-UI-Gtk-Gdk-Events.html#t:TimeStamp">TimeStamp</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-Gdk-Gdk.html#t:GrabStatus">GrabStatus</a></li><li class="src short"><a href="#v:keyboardUngrab">keyboardUngrab</a> :: <a href="Graphics-UI-Gtk-Gdk-Events.html#t:TimeStamp">TimeStamp</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:beep">beep</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:flush" class="def">flush</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#flush" class="link">Source</a></p><div class="doc"><p>Flushes the X output buffer and waits until all requests have been processed by the server. This is rarely needed by applications. </p></div></div><div class="top"><p class="src"><a name="v:screenWidth" class="def">screenWidth</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#screenWidth" class="link">Source</a></p><div class="doc"><p>Returns the width of the default screen in pixels. </p></div></div><div class="top"><p class="src"><a name="v:screenHeight" class="def">screenHeight</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#screenHeight" class="link">Source</a></p><div class="doc"><p>Returns the height of the default screen in pixels. </p></div></div><div class="top"><p class="src"><a name="v:screenWidthMM" class="def">screenWidthMM</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#screenWidthMM" class="link">Source</a></p><div class="doc"><p>Returns the width of the default screen in millimeters. Note that on many X servers this value will not be correct. </p></div></div><div class="top"><p class="src"><a name="v:screenHeightMM" class="def">screenHeightMM</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#screenHeightMM" class="link">Source</a></p><div class="doc"><p>Returns the height of the default screen in millimeters. Note that on many X servers this value will not be correct. </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:GrabStatus" class="def">GrabStatus</a> <a href="src/Graphics-UI-Gtk-Gdk-Enums.html#GrabStatus" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:GrabSuccess" class="def">GrabSuccess</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:GrabAlreadyGrabbed" class="def">GrabAlreadyGrabbed</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:GrabInvalidTime" class="def">GrabInvalidTime</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:GrabNotViewable" class="def">GrabNotViewable</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:GrabFrozen" class="def">GrabFrozen</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:GrabStatus" class="caption collapser" onclick="toggleSection('i:GrabStatus')">Instances</p><div id="section.i:GrabStatus" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Enum">Enum</a> <a href="Graphics-UI-Gtk-Gdk-Gdk.html#t:GrabStatus">GrabStatus</a></td><td class="doc"><p>Specifies why a selection ownership was changed. </p><dl><dt><code>OwnerChangeNewOwner</code></dt><dd> some other application claimed the ownership </dd><dt><code>OwnerChangeDestroy</code></dt><dd> the window was destroyed </dd><dt><code>OwnerChangeClose</code></dt><dd> the client was closed </dd></dl></td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Graphics-UI-Gtk-Gdk-Gdk.html#t:GrabStatus">GrabStatus</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> <a href="Graphics-UI-Gtk-Gdk-Gdk.html#t:GrabStatus">GrabStatus</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:pointerGrab" class="def">pointerGrab</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#pointerGrab" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Graphics-UI-Gtk-Gdk-DrawWindow.html#t:DrawWindowClass">DrawWindowClass</a> window, <a href="Graphics-UI-Gtk-Gdk-DrawWindow.html#t:DrawWindowClass">DrawWindowClass</a> confine_to)</td><td class="doc empty"> </td></tr><tr><td class="src">=> window</td><td class="doc"><p><code>window</code> - the <code><a href="Graphics-UI-Gtk-Gdk-DrawWindow.html#t:DrawWindow">DrawWindow</a></code> which will own the grab (the grab window). </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p><code>owner_events</code> - if <code>False</code> then all pointer events are reported with respect to <code>window</code> and are only reported if selected by <code>event_mask</code>. If <code>True</code> then pointer events for this application are reported as normal, but pointer events outside this application are reported with respect to <code>window</code> and only if selected by <code>event_mask</code>. In either mode, unreported events are discarded. </p></td></tr><tr><td class="src">-> [<a href="Graphics-UI-Gtk-General-Enums.html#t:EventMask">EventMask</a>]</td><td class="doc"><p><code>event_mask</code> - specifies the event mask, which is used in accordance with <code>owner_events</code>. Note that only pointer events (i.e. button and motion events) may be selected. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> confine_to</td><td class="doc"><p><code>confine_to</code> If supplied, the pointer will be confined to this window during the grab. If the pointer is outside <code>confine_to</code>, it will automatically be moved to the closest edge of <code>confine_to</code> and enter and leave events will be generated as necessary. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Graphics-UI-Gtk-Gdk-Cursor.html#t:Cursor">Cursor</a></td><td class="doc"><p><code>cursor</code> - the cursor to display while the grab is active. If this is <code>Nothing</code> then the normal cursors are used for <code>window</code> and its descendants, and the cursor for <code>window</code> is used for all other windows. </p></td></tr><tr><td class="src">-> <a href="Graphics-UI-Gtk-Gdk-Events.html#t:TimeStamp">TimeStamp</a></td><td class="doc"><p><code>time</code> - the timestamp of the event which led to this pointer grab. This usually comes from an <code><a href="Graphics-UI-Gtk-Gdk-Events.html#t:Event">Event</a></code>, though <code><a href="Graphics-UI-Gtk-Gdk-Events.html#v:currentTime">currentTime</a></code> can be used if the time isn't known. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-Gdk-Gdk.html#t:GrabStatus">GrabStatus</a></td><td class="doc"><p><code>Returns</code> - <code><a href="Graphics-UI-Gtk-Gdk-Gdk.html#v:GrabSuccess">GrabSuccess</a></code> if the grab was successful. </p></td></tr></table></div><div class="doc"><p>Grabs the pointer (usually a mouse) so that all events are passed to this application until the pointer is ungrabbed with <code><a href="Graphics-UI-Gtk-Gdk-Gdk.html#v:pointerUngrab">pointerUngrab</a></code>, or the grab window becomes unviewable. This overrides any previous pointer grab by this client. </p><p>Pointer grabs are used for operations which need complete control over mouse events, even if the mouse leaves the application. For example in GTK+ it is used for Drag and Drop, for dragging the handle in the GtkHPaned and GtkVPaned widgets, and for resizing columns in GtkCList widgets. </p><p>Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press and release events in pairs. It is equivalent to a pointer grab on the window with <code>owner_events</code> set to <code>True</code>. </p><p>If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the GdkEventGrabBroken events that are emitted when the grab ends unvoluntarily. </p></div></div><div class="top"><p class="src"><a name="v:pointerUngrab" class="def">pointerUngrab</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#pointerUngrab" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-Gdk-Events.html#t:TimeStamp">TimeStamp</a></td><td class="doc"><p><code>time</code> - a timestamp from an <code><a href="Graphics-UI-Gtk-Gdk-Events.html#t:Event">Event</a></code>, or <code><a href="Graphics-UI-Gtk-Gdk-Events.html#v:currentTime">currentTime</a></code> if no timestamp is available. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Ungrabs the pointer on the default display, if it is grabbed by this application. </p></div></div><div class="top"><p class="src"><a name="v:pointerIsGrabbed" class="def">pointerIsGrabbed</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#pointerIsGrabbed" class="link">Source</a></p><div class="doc"><p>Returns <code>True</code> if the pointer on the default display is currently grabbed by this application. </p><p>Note that this does not take the inmplicit pointer grab on button presses into account. </p></div></div><div class="top"><p class="src"><a name="v:keyboardGrab" class="def">keyboardGrab</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#keyboardGrab" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-Gdk-DrawWindow.html#t:DrawWindowClass">DrawWindowClass</a> window</td><td class="doc empty"> </td></tr><tr><td class="src">=> window</td><td class="doc"><p><code>window</code> - the <code><a href="Graphics-UI-Gtk-Gdk-DrawWindow.html#t:DrawWindow">DrawWindow</a></code> which will own the grab (the grab window). </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p><code>owner_events</code> - if <code>False</code> then all keyboard events are reported with respect to <code>window</code>. If <code>True</code> then keyboard events for this application are reported as normal, but keyboard events outside this application are reported with respect to <code>window</code>. Both key press and key release events are always reported, independant of the event mask set by the application. </p></td></tr><tr><td class="src">-> <a href="Graphics-UI-Gtk-Gdk-Events.html#t:TimeStamp">TimeStamp</a></td><td class="doc"><p><code>time</code> - a timestamp from an <code><a href="Graphics-UI-Gtk-Gdk-Events.html#t:Event">Event</a></code>, or <code><a href="Graphics-UI-Gtk-Gdk-Events.html#v:currentTime">currentTime</a></code> if no timestamp is available. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-Gdk-Gdk.html#t:GrabStatus">GrabStatus</a></td><td class="doc"><p><code>Returns</code> - <code><a href="Graphics-UI-Gtk-Gdk-Gdk.html#v:GrabSuccess">GrabSuccess</a></code> if the grab was successful. </p></td></tr></table></div><div class="doc"><p>Grabs the keyboard so that all events are passed to this application until the keyboard is ungrabbed with <code><a href="Graphics-UI-Gtk-Gdk-Gdk.html#v:keyboardUngrab">keyboardUngrab</a></code>. This overrides any previous keyboard grab by this client. </p><p>If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the GdkEventGrabBroken events that are emitted when the grab ends unvoluntarily. </p></div></div><div class="top"><p class="src"><a name="v:keyboardUngrab" class="def">keyboardUngrab</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#keyboardUngrab" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-Gdk-Events.html#t:TimeStamp">TimeStamp</a></td><td class="doc"><p><code>time</code> - a timestamp from an <code><a href="Graphics-UI-Gtk-Gdk-Events.html#t:Event">Event</a></code>, or <code><a href="Graphics-UI-Gtk-Gdk-Events.html#v:currentTime">currentTime</a></code> if no timestamp is available. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Ungrabs the keyboard on the default display, if it is grabbed by this application. </p></div></div><div class="top"><p class="src"><a name="v:beep" class="def">beep</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-Gtk-Gdk-Gdk.html#beep" class="link">Source</a></p><div class="doc"><p>Emits a short beep. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>