gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users\@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Gdk.EventM

Contents

- Detail
- Classes
- Event monad and type tags
- Accessor functions for event information
- Auxiliary Definitions

Description

Types and accessors to examine information in events.

Synopsis

- class HasCoordinates a
- class HasRootCoordinates a
- class HasModifier a
- class HasTime a
- type EventM t = ReaderT (Ptr t) IO
- data EAny
- data EKey
- data EButton
- data EScroll
- data EMotion
- data EExpose
- data EVisibility
- data ECrossing
- data EFocus
- data EConfigure
- data EProperty
- data EProximity
- data EWindowState
- data EOwnerChange
- data EGrabBroken
- eventWindow :: EventM any DrawWindow
- eventSent :: EventM any Bool
- eventCoordinates :: HasCoordinates t => EventM t (Double, Double)
- eventRootCoordinates :: HasRootCoordinates t => EventM t (Double, Double)
- eventModifier :: HasModifier t => EventM t [Modifier]
- eventModifierAll :: HasModifier t => EventM t [Modifier]
- eventModifierMouse :: HasModifier t => EventM t [Modifier]
- eventTime :: HasTime t => EventM t TimeStamp
- eventKeyVal :: EventM EKey KeyVal
- eventKeyName :: EventM EKey DefaultGlibString
- eventHardwareKeycode :: EventM EKey KeyCode
- eventKeyboardGroup :: EventM EKey Word8
- data MouseButton
  - = LeftButton
  - | MiddleButton
  - | RightButton
  - | OtherButton Int
- eventButton :: EventM EButton MouseButton
- data Click
  - = SingleClick
  - | DoubleClick
  - | TripleClick
  - | ReleaseClick
- eventClick :: EventM EButton Click
- data ScrollDirection
  - = ScrollUp
  - | ScrollDown
  - | ScrollLeft
  - | ScrollRight
  - | ScrollSmooth
- eventScrollDirection :: EventM EScroll ScrollDirection
- eventIsHint :: EventM EMotion Bool
- eventRequestMotions :: EventM EMotion ()
- eventArea :: EventM EExpose Rectangle
- data VisibilityState
  - = VisibilityUnobscured
  - | VisibilityPartialObscured
  - | VisibilityFullyObscured
- eventVisibilityState :: EventM EVisibility VisibilityState
- data CrossingMode
  - = CrossingNormal
  - | CrossingGrab
  - | CrossingUngrab
  - | CrossingGtkGrab
  - | CrossingGtkUngrab
  - | CrossingStateChanged
  - | CrossingTouchBegin
  - | CrossingTouchEnd
  - | CrossingDeviceSwitch
- eventCrossingMode :: EventM ECrossing CrossingMode
- data NotifyType
  - = NotifyAncestor
  - | NotifyVirtual
  - | NotifyInferior
  - | NotifyNonlinear
  - | NotifyNonlinearVirtual
  - | NotifyUnknown
- eventNotifyType :: EventM ECrossing NotifyType
- eventCrossingFocus :: EventM ECrossing Bool
- eventFocusIn :: EventM EFocus Bool
- eventPosition :: EventM EConfigure (Int, Int)
- eventSize :: EventM EConfigure (Int, Int)
- eventProperty :: EventM EProperty Atom
- data WindowState
  - = WindowStateWithdrawn
  - | WindowStateIconified
  - | WindowStateMaximized
  - | WindowStateSticky
  - | WindowStateFullscreen
  - | WindowStateAbove
  - | WindowStateBelow
  - | WindowStateFocused
  - | WindowStateTiled
  - | WindowStateTopTiled
  - | WindowStateTopResizable
  - | WindowStateRightTiled
  - | WindowStateRightResizable
  - | WindowStateBottomTiled
  - | WindowStateBottomResizable
  - | WindowStateLeftTiled
  - | WindowStateLeftResizable
- eventWindowStateChanged :: EventM EWindowState [WindowState]
- eventWindowState :: EventM EWindowState [WindowState]
- data OwnerChange
  - = OwnerChangeNewOwner
  - | OwnerChangeDestroy
  - | OwnerChangeClose
- eventChangeReason :: EventM EOwnerChange OwnerChange
- eventSelection :: EventM EOwnerChange SelectionTag
- eventSelectionTime :: EventM EOwnerChange TimeStamp
- eventKeyboardGrab :: EventM EGrabBroken Bool
- eventImplicit :: EventM EGrabBroken Bool
- eventGrabWindow :: EventM EGrabBroken (Maybe DrawWindow)
- data Modifier
  - = Shift
  - | Lock
  - | Control
  - | Alt
  - | Alt2
  - | Alt3
  - | Alt4
  - | Alt5
  - | Button1
  - | Button2
  - | Button3
  - | Button4
  - | Button5
  - | MODIFIER_RESERVED_13_MASK
  - | MODIFIER_RESERVED_14_MASK
  - | MODIFIER_RESERVED_15_MASK
  - | MODIFIER_RESERVED_16_MASK
  - | MODIFIER_RESERVED_17_MASK
  - | MODIFIER_RESERVED_18_MASK
  - | MODIFIER_RESERVED_19_MASK
  - | MODIFIER_RESERVED_20_MASK
  - | MODIFIER_RESERVED_21_MASK
  - | MODIFIER_RESERVED_22_MASK
  - | MODIFIER_RESERVED_23_MASK
  - | MODIFIER_RESERVED_24_MASK
  - | MODIFIER_RESERVED_25_MASK
  - | Super
  - | Hyper
  - | Meta
  - | MODIFIER_RESERVED_29_MASK
  - | Release
  - | ModifierMask
- type TimeStamp = Word32
- currentTime :: TimeStamp
- tryEvent :: EventM any () -> EventM any Bool
- stopEvent :: EventM any ()

# Detail

This modules provides a monad that encapsulates the information in an event.

The events a widget can receive are defined in Graphics.UI.Gtk.Abstract.Widget. Every event carries additional information which is accessible through functions in the `EventM` monad. For instance, every event is associated with a `DrawWindow` which is accessed using the `eventWindow` accessor function. Other information is only available in one specific event. For example, the area that has to be redrawn, accessed by `eventArea` is only available in the `exposeEvent`. Indeed, you can only call `eventArea` if the first type parameter of `EventM` is the phantom type `EExpose`. (A phantom type is a type for which no values exist and which is only used to enforce certain constraints on the usage of functions such as `eventArea`.) Some information is available in several but not all events. In order to express these constraints the module defines type classes whose names start with `Has...` but which are not exported, implying that no new instance can be created. (They could be called phantom type classes.) For instance, the mouse pointer coordinates can be retrieved using the function `eventCoordinates` which requires that the first type parameter of `EventM` is in the class `HasCoordinates`. The module supplies instance of class `HasCoordinates` for the types `EButton`, `ECrossing`, `EMotion` and `EScroll`. Thus for all events that require an `EventM` action with one of the types above, the accessor function `eventCoordinates` may be used.

Note that an event handler must always returns `True` if the event was handled or `False` if the event should be dealt with by another event handler. For instance, a handler for a key press should return `False` if the pressed key is not one of those that the widget reacts to. In this case the event is passed to the parent widgets. This ensures that pressing, say, `Alt-F` opens the file menu even if the current input focus is in a text entry widget. In order to facilitate writing handlers that may abort handling an event, this module provides the function `tryEvent`. This function catches pattern match exceptions and returns `False`. If the signal successfully runs to its end, it returns `True`. A typical use is as follows:

    widget `on` keyPressEvent $ tryEvent $ do
      [Control] <- eventModifier
      "Return" <- eventKeyName
      liftIO $ putStrLn "Ctrl-Return pressed"

The rationale is that the action will throw an exception if the two event functions `eventModifier` and `eventKeyName` return something else than what is stated in the pattern. When no exception is thrown, execution continues to the last statement where the event is processed, here we merely print a message. Note that the return value of this statement must be `()` since `tryEvent` always assumes that the function handled the event if no exception is thrown. A handler wrapped by `tryEvent` can also indicate that it cannot handle the given event by calling `stopEvent`.

Finally, not that the `EventM` monad wraps the `IO` monad. As such you can (and usually have to) use `liftIO` to execute `IO` functions.

# Classes

class HasCoordinates a Source #

#### Instances

Instances details

HasCoordinates EButton Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasCoordinates ECrossing Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasCoordinates EMotion Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasCoordinates EScroll Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

class HasRootCoordinates a Source #

#### Instances

Instances details

HasRootCoordinates EButton Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasRootCoordinates ECrossing Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasRootCoordinates EMotion Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasRootCoordinates EScroll Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

class HasModifier a Source #

#### Instances

Instances details

HasModifier EButton Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasModifier ECrossing Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasModifier EKey Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasModifier EMotion Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasModifier EScroll Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

class HasTime a Source #

#### Instances

Instances details

HasTime EButton Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime ECrossing Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EKey Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EMotion Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EOwnerChange Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EProperty Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EProximity Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EScroll Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

# Event monad and type tags

type EventM t = ReaderT (Ptr t) IO Source #

A monad providing access to data in an event.

data EAny Source #

A tag for events that do not carry any event-specific information.

data EKey Source #

A tag for key events.

#### Instances

Instances details

HasModifier EKey Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EKey Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

data EButton Source #

A tag for Button events.

#### Instances

Instances details

HasCoordinates EButton Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasModifier EButton Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasRootCoordinates EButton Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EButton Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

data EScroll Source #

A tag for Scroll events.

#### Instances

Instances details

HasCoordinates EScroll Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasModifier EScroll Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasRootCoordinates EScroll Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EScroll Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

data EMotion Source #

A tag for Motion events.

#### Instances

Instances details

HasCoordinates EMotion Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasModifier EMotion Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasRootCoordinates EMotion Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime EMotion Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

data EExpose Source #

A tag for Expose events.

data EVisibility Source #

A tag for Visibility events.

data ECrossing Source #

A tag for Crossing events.

#### Instances

Instances details

HasCoordinates ECrossing Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasModifier ECrossing Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasRootCoordinates ECrossing Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM
HasTime ECrossing Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

data EFocus Source #

A tag for Focus events.

data EConfigure Source #

A tag for Configure events.

data EProperty Source #

A tag for Property events.

#### Instances

Instances details

HasTime EProperty Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

data EProximity Source #

A tag for Proximity events.

#### Instances

Instances details

HasTime EProximity Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

data EWindowState Source #

A tag for WindowState event.

data EOwnerChange Source #

A tag for OwnerChange events.

#### Instances

Instances details

HasTime EOwnerChange Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.EventM

data EGrabBroken Source #

A tag for GrabBroken events.

# Accessor functions for event information

eventWindow :: EventM any DrawWindow Source #

Retrieve the `DrawWindow` that this event relates to.

eventSent :: EventM any Bool Source #

Query if this event was sent sent explicitly by the application (rather than being generated by human interaction).

eventCoordinates :: HasCoordinates t => EventM t (Double, Double) Source #

Retrieve the `(x,y)` coordinates of the mouse.

eventRootCoordinates :: HasRootCoordinates t => EventM t (Double, Double) Source #

Retrieve the `(x,y)` coordinates of the mouse relative to the root (origin) of the screen.

eventModifier :: HasModifier t => EventM t [Modifier] Source #

Query the modifier keys that were depressed when the event happened. Sticky modifiers such as CapsLock are omitted in the return value. Use `eventModifierAll` your application requires all modifiers. Use `eventModifierMouse` if you just need the mouse buttons.

eventModifierAll :: HasModifier t => EventM t [Modifier] Source #

Query the modifier keys that were depressed when the event happened. The result includes sticky modifiers such as CapsLock. Normally, `eventModifier` is more appropriate in applications.

eventModifierMouse :: HasModifier t => EventM t [Modifier] Source #

Query the mouse buttons that were depressed when the event happened.

eventTime :: HasTime t => EventM t TimeStamp Source #

Query the time when the event occurred.

eventKeyVal :: EventM EKey KeyVal Source #

The key value. See `KeyVal`.

eventKeyName :: EventM EKey DefaultGlibString Source #

The key value as a string. See `KeyVal`.

eventHardwareKeycode :: EventM EKey KeyCode Source #

The hardware key code.

eventKeyboardGroup :: EventM EKey Word8 Source #

The keyboard group.

data MouseButton Source #

Mouse buttons.

Constructors

LeftButton |
MiddleButton |
RightButton |
OtherButton Int |

#### Instances

Instances details

Enum MouseButton Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: MouseButton -> MouseButton Source #

pred :: MouseButton -> MouseButton Source #

toEnum :: Int -> MouseButton Source #

fromEnum :: MouseButton -> Int Source #

enumFrom :: MouseButton -> [MouseButton] Source #

enumFromThen :: MouseButton -> MouseButton -> [MouseButton] Source #

enumFromTo :: MouseButton -> MouseButton -> [MouseButton] Source #

enumFromThenTo :: MouseButton -> MouseButton -> MouseButton -> [MouseButton] Source #

Show MouseButton Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> MouseButton -> ShowS Source # show :: MouseButton -> String Source # showList :: [MouseButton] -> ShowS Source #
Eq MouseButton Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: MouseButton -> MouseButton -> Bool Source # (/=) :: MouseButton -> MouseButton -> Bool Source #

eventButton :: EventM EButton MouseButton Source #

Query the mouse buttons.

data Click Source #

Type of mouse click

Constructors

SingleClick |
DoubleClick |
TripleClick |
ReleaseClick |

#### Instances

Instances details

Enum Click Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods succ :: Click -> Click Source # pred :: Click -> Click Source # toEnum :: Int -> Click Source # fromEnum :: Click -> Int Source # enumFrom :: Click -> [Click] Source # enumFromThen :: Click -> Click -> [Click] Source # enumFromTo :: Click -> Click -> [Click] Source # enumFromThenTo :: Click -> Click -> Click -> [Click] Source #
Show Click Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> Click -> ShowS Source # show :: Click -> String Source # showList :: [Click] -> ShowS Source #
Eq Click Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: Click -> Click -> Bool Source # (/=) :: Click -> Click -> Bool Source #

eventClick :: EventM EButton Click Source #

data ScrollDirection Source #

in which direction was scrolled?

Constructors

ScrollUp |
ScrollDown |
ScrollLeft |
ScrollRight |
ScrollSmooth |

#### Instances

Instances details

Enum ScrollDirection Source # |

Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: ScrollDirection -> ScrollDirection Source #

pred :: ScrollDirection -> ScrollDirection Source #

toEnum :: Int -> ScrollDirection Source #

fromEnum :: ScrollDirection -> Int Source #

enumFrom :: ScrollDirection -> [ScrollDirection] Source #

enumFromThen :: ScrollDirection -> ScrollDirection -> [ScrollDirection] Source #

enumFromTo :: ScrollDirection -> ScrollDirection -> [ScrollDirection] Source #

enumFromThenTo :: ScrollDirection -> ScrollDirection -> ScrollDirection -> [ScrollDirection] Source #

Show ScrollDirection Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> ScrollDirection -> ShowS Source # show :: ScrollDirection -> String Source # showList :: [ScrollDirection] -> ShowS Source #
Eq ScrollDirection Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: ScrollDirection -> ScrollDirection -> Bool Source # (/=) :: ScrollDirection -> ScrollDirection -> Bool Source #

eventScrollDirection :: EventM EScroll ScrollDirection Source #

Query the direction of scrolling.

eventIsHint :: EventM EMotion Bool Source #

Check if the motion event is only a hint rather than the full mouse movement information.

eventRequestMotions :: EventM EMotion () Source #

Request more motion notifies if this event is a motion notify hint event.

This action should be used instead of `drawWindowGetPointer` to request further motion notifies, because it also works for extension events where motion notifies are provided for devices other than the core pointer.

Coordinate extraction, processing and requesting more motion events from a `motionNotifyEvent` usually works like this:

    on widget motionNotifyEvent $ do
      (x, y) <- eventCoordinates
      -- handle the x,y motion:
      ...
      -- finally, notify that we are ready to get more motion events:
      eventRequestMotions

eventArea :: EventM EExpose Rectangle Source #

Query a bounding box of the region that needs to be updated.

data VisibilityState Source #

visibility of a window

Constructors

VisibilityUnobscured |
VisibilityPartialObscured |
VisibilityFullyObscured |

#### Instances

Instances details

Enum VisibilityState Source # |

Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: VisibilityState -> VisibilityState Source #

pred :: VisibilityState -> VisibilityState Source #

toEnum :: Int -> VisibilityState Source #

fromEnum :: VisibilityState -> Int Source #

enumFrom :: VisibilityState -> [VisibilityState] Source #

enumFromThen :: VisibilityState -> VisibilityState -> [VisibilityState] Source #

enumFromTo :: VisibilityState -> VisibilityState -> [VisibilityState] Source #

enumFromThenTo :: VisibilityState -> VisibilityState -> VisibilityState -> [VisibilityState] Source #

Show VisibilityState Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> VisibilityState -> ShowS Source # show :: VisibilityState -> String Source # showList :: [VisibilityState] -> ShowS Source #
Eq VisibilityState Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: VisibilityState -> VisibilityState -> Bool Source # (/=) :: VisibilityState -> VisibilityState -> Bool Source #

eventVisibilityState :: EventM EVisibility VisibilityState Source #

Get the visibility status of a window.

data CrossingMode Source #

How focus is crossing the widget.

Constructors

CrossingNormal |
CrossingGrab |
CrossingUngrab |
CrossingGtkGrab |
CrossingGtkUngrab |
CrossingStateChanged |
CrossingTouchBegin |
CrossingTouchEnd |
CrossingDeviceSwitch |

#### Instances

Instances details

Enum CrossingMode Source # |

Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: CrossingMode -> CrossingMode Source #

pred :: CrossingMode -> CrossingMode Source #

toEnum :: Int -> CrossingMode Source #

fromEnum :: CrossingMode -> Int Source #

enumFrom :: CrossingMode -> [CrossingMode] Source #

enumFromThen :: CrossingMode -> CrossingMode -> [CrossingMode] Source #

enumFromTo :: CrossingMode -> CrossingMode -> [CrossingMode] Source #

enumFromThenTo :: CrossingMode -> CrossingMode -> CrossingMode -> [CrossingMode] Source #

Show CrossingMode Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> CrossingMode -> ShowS Source # show :: CrossingMode -> String Source # showList :: [CrossingMode] -> ShowS Source #
Eq CrossingMode Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: CrossingMode -> CrossingMode -> Bool Source # (/=) :: CrossingMode -> CrossingMode -> Bool Source #

eventCrossingMode :: EventM ECrossing CrossingMode Source #

Get the mode of the mouse cursor crossing a window.

data NotifyType Source #

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

`NotifyAncestor`
  The window is entered from an ancestor or left towards an ancestor.
`NotifyVirtual`
  The pointer moves between an ancestor and an inferior of the window.
`NotifyInferior`
  The window is entered from an inferior or left towards an inferior.
`NotifyNonlinear`
  The window is entered from or left towards a window which is neither an ancestor nor an inferior.
`NotifyNonlinearVirtual`
  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.
`NotifyUnknown`
  The level change does not fit into any of the other categories or could not be determined.

Constructors

NotifyAncestor |
NotifyVirtual |
NotifyInferior |
NotifyNonlinear |
NotifyNonlinearVirtual |
NotifyUnknown |

#### Instances

Instances details

Enum NotifyType Source # |

Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: NotifyType -> NotifyType Source #

pred :: NotifyType -> NotifyType Source #

toEnum :: Int -> NotifyType Source #

fromEnum :: NotifyType -> Int Source #

enumFrom :: NotifyType -> [NotifyType] Source #

enumFromThen :: NotifyType -> NotifyType -> [NotifyType] Source #

enumFromTo :: NotifyType -> NotifyType -> [NotifyType] Source #

enumFromThenTo :: NotifyType -> NotifyType -> NotifyType -> [NotifyType] Source #

Show NotifyType Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> NotifyType -> ShowS Source # show :: NotifyType -> String Source # showList :: [NotifyType] -> ShowS Source #
Eq NotifyType Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: NotifyType -> NotifyType -> Bool Source # (/=) :: NotifyType -> NotifyType -> Bool Source #

eventNotifyType :: EventM ECrossing NotifyType Source #

Get the notify type of the mouse cursor crossing a window.

eventCrossingFocus :: EventM ECrossing Bool Source #

Query if the window has the focus or is an inferior window.

eventFocusIn :: EventM EFocus Bool Source #

Query if a window gained focus (`True`) or lost the focus (`False`).

eventPosition :: EventM EConfigure (Int, Int) Source #

Get the `(x,y)` position of the window within the parent window.

eventSize :: EventM EConfigure (Int, Int) Source #

Get the new size of the window as `(width,height)`.

eventProperty :: EventM EProperty Atom Source #

data WindowState Source #

The state a `DrawWindow` is in.

Constructors

WindowStateWithdrawn |
WindowStateIconified |
WindowStateMaximized |
WindowStateSticky |
WindowStateFullscreen |
WindowStateAbove |
WindowStateBelow |
WindowStateFocused |
WindowStateTiled |
WindowStateTopTiled |
WindowStateTopResizable |
WindowStateRightTiled |
WindowStateRightResizable |
WindowStateBottomTiled |
WindowStateBottomResizable |
WindowStateLeftTiled |
WindowStateLeftResizable |

#### Instances

Instances details

Bounded WindowState Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods minBound :: WindowState Source # maxBound :: WindowState Source #
Enum WindowState Source # | Defines the reference point of a window and the meaning of coordinates passed to `windowMove`. See `windowMove` and the "implementation notes" section of the extended window manager hints specification for more details.

Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: WindowState -> WindowState Source #

pred :: WindowState -> WindowState Source #

toEnum :: Int -> WindowState Source #

fromEnum :: WindowState -> Int Source #

enumFrom :: WindowState -> [WindowState] Source #

enumFromThen :: WindowState -> WindowState -> [WindowState] Source #

enumFromTo :: WindowState -> WindowState -> [WindowState] Source #

enumFromThenTo :: WindowState -> WindowState -> WindowState -> [WindowState] Source #

Show WindowState Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> WindowState -> ShowS Source # show :: WindowState -> String Source # showList :: [WindowState] -> ShowS Source #
Eq WindowState Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: WindowState -> WindowState -> Bool Source # (/=) :: WindowState -> WindowState -> Bool Source #
Flags WindowState Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums

eventWindowStateChanged :: EventM EWindowState [WindowState] Source #

Query which window state bits have changed.

eventWindowState :: EventM EWindowState [WindowState] Source #

Query the new window state.

data OwnerChange Source #

Constructors

OwnerChangeNewOwner |
OwnerChangeDestroy |
OwnerChangeClose |

#### Instances

Instances details

Enum OwnerChange Source # |

Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: OwnerChange -> OwnerChange Source #

pred :: OwnerChange -> OwnerChange Source #

toEnum :: Int -> OwnerChange Source #

fromEnum :: OwnerChange -> Int Source #

enumFrom :: OwnerChange -> [OwnerChange] Source #

enumFromThen :: OwnerChange -> OwnerChange -> [OwnerChange] Source #

enumFromTo :: OwnerChange -> OwnerChange -> [OwnerChange] Source #

enumFromThenTo :: OwnerChange -> OwnerChange -> OwnerChange -> [OwnerChange] Source #

Show OwnerChange Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> OwnerChange -> ShowS Source # show :: OwnerChange -> String Source # showList :: [OwnerChange] -> ShowS Source #
Eq OwnerChange Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: OwnerChange -> OwnerChange -> Bool Source # (/=) :: OwnerChange -> OwnerChange -> Bool Source #

eventChangeReason :: EventM EOwnerChange OwnerChange Source #

Query why a seleciton changed its owner.

eventSelection :: EventM EOwnerChange SelectionTag Source #

Query what selection changed its owner.

eventSelectionTime :: EventM EOwnerChange TimeStamp Source #

Query the time when the selection was taken over.

eventKeyboardGrab :: EventM EGrabBroken Bool Source #

Check if a keyboard (`True`) or a mouse pointer grap (`False`) was broken.

eventImplicit :: EventM EGrabBroken Bool Source #

Check if a grab was broken implicitly.

eventGrabWindow :: EventM EGrabBroken (Maybe DrawWindow) Source #

Get the new window that owns the grab or `Nothing` if the window is not part of this application.

# Auxiliary Definitions

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 modifiers 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.

Constructors

Shift |
Lock |
Control |
Alt |
Alt2 |
Alt3 |
Alt4 |
Alt5 |
Button1 |
Button2 |
Button3 |
Button4 |
Button5 |
MODIFIER_RESERVED_13_MASK |
MODIFIER_RESERVED_14_MASK |
MODIFIER_RESERVED_15_MASK |
MODIFIER_RESERVED_16_MASK |
MODIFIER_RESERVED_17_MASK |
MODIFIER_RESERVED_18_MASK |
MODIFIER_RESERVED_19_MASK |
MODIFIER_RESERVED_20_MASK |
MODIFIER_RESERVED_21_MASK |
MODIFIER_RESERVED_22_MASK |
MODIFIER_RESERVED_23_MASK |
MODIFIER_RESERVED_24_MASK |
MODIFIER_RESERVED_25_MASK |
Super |
Hyper |
Meta |
MODIFIER_RESERVED_29_MASK |
Release |
ModifierMask |

#### Instances

Instances details

Bounded Modifier Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods minBound :: Modifier Source # maxBound :: Modifier Source #
Enum Modifier Source # |

Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: Modifier -> Modifier Source #

pred :: Modifier -> Modifier Source #

toEnum :: Int -> Modifier Source #

fromEnum :: Modifier -> Int Source #

enumFrom :: Modifier -> [Modifier] Source #

enumFromThen :: Modifier -> Modifier -> [Modifier] Source #

enumFromTo :: Modifier -> Modifier -> [Modifier] Source #

enumFromThenTo :: Modifier -> Modifier -> Modifier -> [Modifier] Source #

Show Modifier Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> Modifier -> ShowS Source # show :: Modifier -> String Source # showList :: [Modifier] -> ShowS Source #
Eq Modifier Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: Modifier -> Modifier -> Bool Source # (/=) :: Modifier -> Modifier -> Bool Source #
Flags Modifier Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums

type TimeStamp = Word32 Source #

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

currentTime :: TimeStamp Source #

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

tryEvent :: EventM any () -> EventM any Bool Source #

Execute an event handler and assume it handled the event unless it threw a pattern match exception or calls mzero (e.g. via guard).

stopEvent :: EventM any () Source #

Explicitly stop the handling of an event. This function should only be called inside a handler that is wrapped with `tryEvent`. (It merely throws a bogus pattern matching error which `tryEvent` interprets as if the handler does not handle the event.)