gtk-0.11.0: Binding to the Gtk+ graphical user interface library.

Portabilityportable (depends on GHC)



Definiton of a record that contains event information. Deprecated in favor of Graphics.UI.Gtk.Gdk.EventM.



data Modifier Source

Keyboard modifiers that are depressed when the user presses a key or a mouse button.

  • This data type is used to build lists of modifers that were active during an event.
  • The Apple key on Macintoshs is mapped to Alt2 and the Meta key (if available).
  • Since Gtk 2.10, there are also Super, Hyper and Meta modifiers which are simply generated from Alt .. Compose modifier keys, depending on the mapping used by the windowing system. Due to one key being mapped to e.g. Alt2 and Meta, you shouldn't pattern match directly against a certain key but check whether a key is in the list using the elem function, say.

type TimeStamp = Word32Source

The time (in milliseconds) when an event happened. This is used mostly for ordering events and responses to events.

currentTime :: TimeStampSource

Represents the current time, and can be used anywhere a time is expected.

Deprecated way of conveying event information.

data Event Source

Events that are delivered to a widget.

  • Any given signal only emits one of these variants as described in Graphics.UI.Gtk.Abstract.Widget.Widget. Many events share common attributes:
  • The eventSent attribute is True if the event was not created by the user but by another application.
  • The eventTime attribute contains a time in milliseconds when the event happened.
  • The eventX and eventY attributes contain the coordinates relative to the Graphics.UI.Gtk.Abstract.Gdk.DrawWindow associated with this widget. The values can contain sub-pixel information if the input device is a graphics tablet or the like.
  • The eventModifier attribute denotes what modifier key was pressed during the event.



An event that is not in one of the more specific categories below. This includes delete, destroy, map and unmap events. These events have no extra information associated with them.


eventSent :: Bool

The expose event.

  • A region of widget that receives this event needs to be redrawn. This event is the result of revealing part or all of a window or by the application calling functions like Graphics.UI.Gtk.Abstract.Widget.widgetQueueDrawArea.


eventSent :: Bool
eventArea :: Rectangle

A bounding box denoting what needs to be updated. For a more detailed information on the area that needs redrawing, use the next field.

eventRegion :: Region

A set of horizontal stripes that denote the invalid area.

eventCount :: Int

The number of contiguous Expose events following this one. The only use for this is "exposure compression", i.e. handling all contiguous Expose events in one go, though Gdk performs some exposure compression so this is not normally needed.


Mouse motion.

  • Captures the movement of the mouse cursor while it is within the area of the widget.


eventSent :: Bool
eventTime :: TimeStamp
eventX :: Double
eventY :: Double
eventModifier :: [Modifier]
eventIsHint :: Bool

Indicate if this event is only a hint of the motion.

  • If the Graphics.UI.Gtk.Abstract.Widget.PointerMotionHintMask is set with Data.Array.MArray.widgetAddEvents then mouse positions are only generated each time Graphics.UI.Gtk.Gdk.DrawWindow.drawWindowGetPointer is called. In this case eventIsHint is set to True.
eventXRoot :: Double
eventYRoot :: Double

A mouse button was pressed or released.

  • This event is triggered if the mouse button was pressed or released while the mouse cursor was within the region of the widget.


eventSent :: Bool
eventClick :: Click

The kind of button press, see Click. Note that double clicks will trigger this event with eventClick set to SingleClick, ReleaseClick, SingleClick, DoubleClick, ReleaseClick. Triple clicks will produce this sequence followed by SingleClick, DoubleClick, TripleClick, ReleaseClick.

eventTime :: TimeStamp
eventX :: Double
eventY :: Double
eventModifier :: [Modifier]
eventButton :: MouseButton

The button that was pressed.

eventXRoot :: Double
eventYRoot :: Double

A key was pressed while the widget had the input focus.

  • If the widget has the current input focus (see Graphics.UI.Gtk.Abstract.Widget.widgetSetCanFocus) it will receive key pressed events. Certain key combinations are of no interest to a normal widget like Alt-F to access the file menu. For all these keys, the handler must return False to indicate that the key stroke should be propagated to the parent widget. At the top-level widget, keyboard shortcuts like Alt-F are turned into the corresponding signals.


eventRelease :: Bool

This flag is set if the key was released. This flag makes it possible to connect the same handler to Graphics.UI.Gtk.Abstract.Widget.onKeyPress and Graphics.UI.Gtk.Abstract.Widget.onKeyRelease.

eventSent :: Bool
eventTime :: TimeStamp
eventModifier :: [Modifier]
eventWithCapsLock :: Bool

This flag is True if Caps Lock is on while this key was pressed.

eventWithNumLock :: Bool

This flag is True if Number Lock is on while this key was pressed.

eventWithScrollLock :: Bool

This flag is True if Scroll Lock is on while this key was pressed.

eventKeyVal :: KeyVal

A number representing the key that was pressed or released. A more convenient interface is provided by the next two fields.

eventKeyName :: String

A string representing the key that was pressed or released.

  • This string contains a description of the key rather than what should appear on screen. For example, pressing 1 on the keypad results in KP_1. Of particular interest are F1 till F12, for a complete list refer to "gdk/gdkkeysyms.h" where all possible values are defined. The corresponding strings are the constants without the GDK_ prefix.
eventKeyChar :: Maybe Char

A character matching the key that was pressed.

  • This entry can be used to build up a whole input string. The character is Nothing if the key does not correspond to a simple unicode character.

Mouse cursor crossing event.

  • This event indicates that the mouse cursor is hovering over this widget. It is used to set a widget into the pre-focus state where some GUI elements like buttons on a toolbar change their appearance.


eventSent :: Bool
eventTime :: TimeStamp
eventX :: Double
eventY :: Double
eventXRoot :: Double
eventYRoot :: Double
eventLeaves :: Bool

This flag is false if the widget was entered, it is true when the widget the mouse cursor left the widget.

eventCrossingMode :: CrossingMode

Kind of enter/leave event.

  • The mouse cursor might enter this widget because it grabs the mouse cursor for e.g. a modal dialog box.
eventNotifyType :: NotifyType

Information on from what level of the widget hierarchy the mouse cursor came.

eventModifier :: [Modifier]

Gaining or loosing input focus.


eventSent :: Bool
eventInFocus :: Bool

This flag is True if the widget receives the focus and False if it just lost the input focus.


The widget's size has changed.

  • In response to this event the application can allocate resources that are specific to the size of the widget. It is emitted when the widget is shown the first time and on every resize.


eventSent :: Bool
eventXParent :: Int

Position within the parent window.

eventYParent :: Int

Position within the parent window.

eventWidth :: Int
eventHeight :: Int

Change of visibility of a widget.


eventSent :: Bool
eventVisible :: VisibilityState

Denote what portions of the widget is visible.


Wheel movement of the mouse.

  • This action denotes that the content of the widget should be scrolled. The event is triggered by the movement of the mouse wheel. Surrounding scroll bars are independant of this signal. Most mice do not have buttons for horizontal scrolling, hence eventDirection will usually not contain ScrollLeft and ScrollRight. Mice with additional buttons may not work on X since only five buttons are supported (the three main buttons and two for the wheel).
  • The handler of this signal should update the scroll bars that surround this widget which in turn tell this widget to update.

Indicate how the appearance of this window has changed.


eventSent :: Bool
eventWindowMask :: [WindowState]

The mask indicates which flags have changed.

eventWindowState :: [WindowState]

The state indicates the current state of the window.


The state of the pen of a graphics tablet pen or touchscreen device.


eventSent :: Bool
eventTime :: TimeStamp
eventInContact :: Bool

Whether the stylus has moved in or out of contact with the tablet.


type EventButton = EventSource

An event that contains information on a button press.

type EventScroll = EventSource

An event that contains information on scrolling.

type EventMotion = EventSource

An event that contains information on the movement of the mouse pointer.

type EventExpose = EventSource

An area of the DrawWindow needs redrawing.

type EventKey = EventSource

An event that contains information about a key press.

type EventConfigure = EventSource

An event that contains the new size of a window.

type EventCrossing = EventSource

Generated when the pointer enters or leaves a window.

type EventFocus = EventSource

An event that informs about a change of the input focus.

type EventProperty = EventSource

An event that indicates a property of the window changed.

type EventProximity = EventSource

An event that indicates that the pen of a graphics table is touching or not touching the tablet.

type EventVisibility = EventSource

Parts of the window have been exposed or obscured.

type EventWindowState = EventSource

The window state has changed.

type EventGrabBroken = EventSource

A grab has been broken by unusual means.

data NotifyType Source

Information on from what level of the widget hierarchy the mouse cursor came.

The window is entered from an ancestor or left towards an ancestor.
The pointer moves between an ancestor and an inferior of the window.
The window is entered from an inferior or left towards an inferior.
The window is entered from or left towards a window which is neither an ancestor nor an inferior.
The pointer moves between two windows which are not ancestors of each other and the window is part of the ancestor chain between one of these windows and their least common ancestor.
The level change does not fit into any of the other categories or could not be determined.


Enum NotifyType

Determine if child widget may be overdrawn.

Eq NotifyType 
Show NotifyType 

data WindowState Source

The state a DrawWindow is in.


Bounded WindowState 
Enum WindowState

These are hints for the window manager that indicate what type of function the window has. The window manager can use this when determining decoration and behaviour of the window. The hint must be set before mapping the window.

See the extended window manager hints specification for more details about window types.

Eq WindowState 
Show WindowState 
Flags WindowState 

data ScrollDirection Source

in which direction was scrolled?

data Click Source

Type of mouse click


data Rectangle


  • Specifies x, y, width and height


Rectangle Int Int Int Int