Gtk2HsContentsIndex
Graphics.UI.Gtk.Abstract.Widget
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Contents
Detail
Class Hierarchy
Types
Methods
Attributes
Signals
Events
Deprecated
Description
The base class for all widgets.
Synopsis
data Widget
class ObjectClass o => WidgetClass o
castToWidget :: GObjectClass obj => obj -> Widget
toWidget :: WidgetClass o => o -> Widget
data EventMask
= ExposureMask
| PointerMotionMask
| PointerMotionHintMask
| ButtonMotionMask
| Button1MotionMask
| Button2MotionMask
| Button3MotionMask
| ButtonPressMask
| ButtonReleaseMask
| KeyPressMask
| KeyReleaseMask
| EnterNotifyMask
| LeaveNotifyMask
| FocusChangeMask
| StructureMask
| PropertyChangeMask
| VisibilityNotifyMask
| ProximityInMask
| ProximityOutMask
| SubstructureMask
| ScrollMask
| AllEventsMask
data ExtensionMode
= ExtensionEventsNone
| ExtensionEventsAll
| ExtensionEventsCursor
type GType = CULong
type KeyVal = Word32
data Region
type Bitmap = Pixmap
data Requisition = Requisition Int Int
data Rectangle = Rectangle Int Int Int Int
data Color
data IconSize
= IconSizeInvalid
| IconSizeMenu
| IconSizeSmallToolbar
| IconSizeLargeToolbar
| IconSizeButton
| IconSizeDnd
| IconSizeDialog
| IconSizeUser Int
data StateType
= StateNormal
| StateActive
| StatePrelight
| StateSelected
| StateInsensitive
data TextDirection
= TextDirNone
| TextDirLtr
| TextDirRtl
data AccelFlags
= AccelVisible
| AccelLocked
| AccelMask
data DirectionType
= DirTabForward
| DirTabBackward
| DirUp
| DirDown
| DirLeft
| DirRight
type StockId = String
data WidgetHelpType
= WidgetHelpTooltip
| WidgetHelpWhatsThis
widgetShow :: WidgetClass self => self -> IO ()
widgetShowNow :: WidgetClass self => self -> IO ()
widgetHide :: WidgetClass self => self -> IO ()
widgetShowAll :: WidgetClass self => self -> IO ()
widgetHideAll :: WidgetClass self => self -> IO ()
widgetDestroy :: WidgetClass self => self -> IO ()
widgetQueueDraw :: WidgetClass self => self -> IO ()
widgetQueueResize :: WidgetClass self => self -> IO ()
widgetQueueResizeNoRedraw :: WidgetClass self => self -> IO ()
widgetSizeRequest :: WidgetClass self => self -> IO Requisition
widgetGetChildRequisition :: WidgetClass self => self -> IO Requisition
widgetSizeAllocate :: WidgetClass self => self -> Allocation -> IO ()
widgetAddAccelerator :: WidgetClass self => self -> String -> AccelGroup -> KeyVal -> [Modifier] -> [AccelFlags] -> IO ()
widgetRemoveAccelerator :: WidgetClass self => self -> AccelGroup -> KeyVal -> [Modifier] -> IO Bool
widgetSetAccelPath :: WidgetClass self => self -> String -> AccelGroup -> IO ()
widgetCanActivateAccel :: WidgetClass self => ConnectId self -> IO Bool
widgetActivate :: WidgetClass self => self -> IO Bool
widgetIntersect :: WidgetClass self => self -> Rectangle -> IO (Maybe Rectangle)
widgetHasIntersection :: WidgetClass self => self -> Rectangle -> IO Bool
widgetGetIsFocus :: WidgetClass self => self -> IO Bool
widgetGrabFocus :: WidgetClass self => self -> IO ()
widgetGrabDefault :: WidgetClass self => self -> IO ()
widgetSetName :: WidgetClass self => self -> String -> IO ()
widgetGetName :: WidgetClass self => self -> IO String
widgetSetSensitive :: WidgetClass self => self -> Bool -> IO ()
widgetSetSensitivity :: WidgetClass self => self -> Bool -> IO ()
widgetGetParentWindow :: WidgetClass self => self -> IO DrawWindow
widgetGetDrawWindow :: WidgetClass widget => widget -> IO DrawWindow
widgetDelEvents :: WidgetClass self => self -> [EventMask] -> IO ()
widgetAddEvents :: WidgetClass self => self -> [EventMask] -> IO ()
widgetGetEvents :: WidgetClass self => self -> IO [EventMask]
widgetSetEvents :: WidgetClass self => self -> [EventMask] -> IO ()
widgetSetExtensionEvents :: WidgetClass self => self -> [ExtensionMode] -> IO ()
widgetGetExtensionEvents :: WidgetClass self => self -> IO [ExtensionMode]
widgetGetToplevel :: WidgetClass self => self -> IO Widget
widgetGetAncestor :: WidgetClass self => self -> GType -> IO (Maybe Widget)
widgetGetColormap :: WidgetClass self => self -> IO Colormap
widgetSetColormap :: WidgetClass self => self -> Colormap -> IO ()
widgetGetPointer :: WidgetClass self => self -> IO (Int, Int)
widgetIsAncestor :: (WidgetClass self, WidgetClass ancestor) => self -> ancestor -> IO Bool
widgetTranslateCoordinates :: (WidgetClass self, WidgetClass destWidget) => self -> destWidget -> Int -> Int -> IO (Maybe (Int, Int))
widgetSetStyle :: WidgetClass self => self -> Maybe Style -> IO ()
widgetGetStyle :: WidgetClass widget => widget -> IO Style
widgetPushColormap :: Colormap -> IO ()
widgetPopColormap :: IO ()
widgetSetDefaultColormap :: Colormap -> IO ()
widgetGetDefaultStyle :: IO Style
widgetGetDefaultColormap :: IO Colormap
widgetSetDirection :: WidgetClass self => self -> TextDirection -> IO ()
widgetGetDirection :: WidgetClass self => self -> IO TextDirection
widgetSetDefaultDirection :: TextDirection -> IO ()
widgetGetDefaultDirection :: IO TextDirection
widgetShapeCombineMask :: WidgetClass self => self -> Maybe Bitmap -> Int -> Int -> IO ()
widgetInputShapeCombineMask :: WidgetClass self => self -> Maybe Bitmap -> Int -> Int -> IO ()
widgetPath :: WidgetClass self => self -> IO (Int, String, String)
widgetClassPath :: WidgetClass self => self -> IO (Int, String, String)
widgetGetCompositeName :: WidgetClass self => self -> IO (Maybe String)
widgetModifyStyle :: (WidgetClass self, RcStyleClass style) => self -> style -> IO ()
widgetGetModifierStyle :: WidgetClass self => self -> IO RcStyle
widgetModifyFg :: WidgetClass self => self -> StateType -> Color -> IO ()
widgetModifyBg :: WidgetClass self => self -> StateType -> Color -> IO ()
widgetModifyText :: WidgetClass self => self -> StateType -> Color -> IO ()
widgetModifyBase :: WidgetClass self => self -> StateType -> Color -> IO ()
widgetModifyFont :: WidgetClass self => self -> Maybe FontDescription -> IO ()
widgetCreatePangoContext :: WidgetClass self => self -> IO PangoContext
widgetGetPangoContext :: WidgetClass self => self -> IO PangoContext
widgetCreateLayout :: WidgetClass self => self -> String -> IO PangoLayout
widgetRenderIcon :: WidgetClass self => self -> String -> IconSize -> String -> IO (Maybe Pixbuf)
widgetQueueDrawArea :: WidgetClass self => self -> Int -> Int -> Int -> Int -> IO ()
widgetResetShapes :: WidgetClass self => self -> IO ()
widgetSetAppPaintable :: WidgetClass self => self -> Bool -> IO ()
widgetSetDoubleBuffered :: WidgetClass self => self -> Bool -> IO ()
widgetSetRedrawOnAllocate :: WidgetClass self => self -> Bool -> IO ()
widgetSetCompositeName :: WidgetClass self => self -> String -> IO ()
widgetSetScrollAdjustments :: WidgetClass self => self -> Maybe Adjustment -> Maybe Adjustment -> IO Bool
widgetRegionIntersect :: WidgetClass self => self -> Region -> IO Region
widgetGetAccessible :: WidgetClass self => self -> IO Object
widgetChildFocus :: WidgetClass self => self -> DirectionType -> IO Bool
widgetGetChildVisible :: WidgetClass self => self -> IO Bool
widgetGetParent :: WidgetClass self => self -> IO (Maybe Widget)
widgetGetSettings :: WidgetClass self => self -> IO Settings
widgetGetDisplay :: WidgetClass self => self -> IO Display
widgetGetRootWindow :: WidgetClass self => self -> IO DrawWindow
widgetGetScreen :: WidgetClass self => self -> IO Screen
widgetHasScreen :: WidgetClass self => self -> IO Bool
widgetGetSizeRequest :: WidgetClass self => self -> IO (Int, Int)
widgetSetChildVisible :: WidgetClass self => self -> Bool -> IO ()
widgetSetSizeRequest :: WidgetClass self => self -> Int -> Int -> IO ()
widgetSetNoShowAll :: WidgetClass self => self -> Bool -> IO ()
widgetGetNoShowAll :: WidgetClass self => self -> IO Bool
widgetListMnemonicLabels :: WidgetClass self => self -> IO [Widget]
widgetAddMnemonicLabel :: (WidgetClass self, WidgetClass label) => self -> label -> IO ()
widgetRemoveMnemonicLabel :: (WidgetClass self, WidgetClass label) => self -> label -> IO ()
widgetGetAction :: WidgetClass self => self -> IO (Maybe Action)
widgetIsComposited :: WidgetClass self => self -> IO Bool
widgetReparent :: (WidgetClass self, WidgetClass newParent) => self -> newParent -> IO ()
widgetGetCanFocus :: WidgetClass self => self -> IO Bool
widgetSetCanFocus :: WidgetClass self => self -> Bool -> IO ()
widgetGetState :: WidgetClass w => w -> IO StateType
widgetGetSavedState :: WidgetClass w => w -> IO StateType
widgetGetSize :: WidgetClass widget => widget -> IO (Int, Int)
widgetName :: WidgetClass self => Attr self (Maybe String)
widgetParent :: (WidgetClass self, ContainerClass container) => ReadWriteAttr self (Maybe Container) (Maybe container)
widgetWidthRequest :: WidgetClass self => Attr self Int
widgetHeightRequest :: WidgetClass self => Attr self Int
widgetVisible :: WidgetClass self => Attr self Bool
widgetSensitive :: WidgetClass self => Attr self Bool
widgetAppPaintable :: WidgetClass self => Attr self Bool
widgetCanFocus :: WidgetClass self => Attr self Bool
widgetHasFocus :: WidgetClass self => Attr self Bool
widgetIsFocus :: WidgetClass self => Attr self Bool
widgetCanDefault :: WidgetClass self => Attr self Bool
widgetHasDefault :: WidgetClass self => Attr self Bool
widgetReceivesDefault :: WidgetClass self => Attr self Bool
widgetCompositeChild :: WidgetClass self => ReadAttr self Bool
widgetStyle :: WidgetClass self => Attr self Style
widgetEvents :: WidgetClass self => Attr self [EventMask]
widgetExtensionEvents :: WidgetClass self => Attr self [ExtensionMode]
widgetNoShowAll :: WidgetClass self => Attr self Bool
widgetChildVisible :: WidgetClass self => Attr self Bool
widgetColormap :: WidgetClass self => Attr self Colormap
widgetCompositeName :: WidgetClass self => ReadWriteAttr self (Maybe String) String
widgetDirection :: WidgetClass self => Attr self TextDirection
realize :: WidgetClass self => Signal self (IO ())
unrealize :: WidgetClass self => Signal self (IO ())
mapSignal :: WidgetClass self => Signal self (IO ())
unmapSignal :: WidgetClass self => Signal self (IO ())
sizeRequest :: WidgetClass self => Signal self (IO Requisition)
sizeAllocate :: WidgetClass self => Signal self (Allocation -> IO ())
showSignal :: WidgetClass self => Signal self (IO ())
hideSignal :: WidgetClass self => Signal self (IO ())
focus :: WidgetClass self => Signal self (DirectionType -> IO Bool)
stateChanged :: WidgetClass self => Signal self (StateType -> IO ())
parentSet :: WidgetClass self => Signal self (Widget -> IO ())
hierarchyChanged :: WidgetClass self => Signal self (Widget -> IO ())
styleSet :: WidgetClass self => Signal self (Style -> IO ())
directionChanged :: WidgetClass self => Signal self (TextDirection -> IO ())
grabNotify :: WidgetClass self => Signal self (Bool -> IO ())
popupMenuSignal :: WidgetClass self => Signal self (IO Bool)
showHelp :: WidgetClass self => Signal self (WidgetHelpType -> IO Bool)
accelClosuresChanged :: WidgetClass self => Signal self (IO ())
screenChanged :: WidgetClass self => Signal self (Screen -> IO ())
buttonPressEvent :: WidgetClass self => Signal self (EventM EButton Bool)
buttonReleaseEvent :: WidgetClass self => Signal self (EventM EButton Bool)
configureEvent :: WidgetClass self => Signal self (EventM EConfigure Bool)
deleteEvent :: WidgetClass self => Signal self (EventM EAny Bool)
destroyEvent :: WidgetClass self => Signal self (EventM EAny Bool)
enterNotifyEvent :: WidgetClass self => Signal self (EventM ECrossing Bool)
exposeEvent :: WidgetClass self => Signal self (EventM EExpose Bool)
focusInEvent :: WidgetClass self => Signal self (EventM EFocus Bool)
focusOutEvent :: WidgetClass self => Signal self (EventM EFocus Bool)
grabBrokenEvent :: WidgetClass self => Signal self (EventM EGrabBroken Bool)
keyPressEvent :: WidgetClass self => Signal self (EventM EKey Bool)
keyReleaseEvent :: WidgetClass self => Signal self (EventM EKey Bool)
leaveNotifyEvent :: WidgetClass self => Signal self (EventM ECrossing Bool)
mapEvent :: WidgetClass self => Signal self (EventM EAny Bool)
motionNotifyEvent :: WidgetClass self => Signal self (EventM EMotion Bool)
noExposeEvent :: WidgetClass self => Signal self (EventM EAny Bool)
proximityInEvent :: WidgetClass self => Signal self (EventM EProximity Bool)
proximityOutEvent :: WidgetClass self => Signal self (EventM EProximity Bool)
scrollEvent :: WidgetClass self => Signal self (EventM EScroll Bool)
unmapEvent :: WidgetClass self => Signal self (EventM EAny Bool)
visibilityNotifyEvent :: WidgetClass self => Signal self (EventM EVisibility Bool)
windowStateEvent :: WidgetClass self => Signal self (EventM EWindowState Bool)
onButtonPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterButtonPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onButtonRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterButtonRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onClient :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterClient :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onConfigure :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterConfigure :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onDelete :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterDelete :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onDestroyEvent :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterDestroyEvent :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onDirectionChanged :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterDirectionChanged :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onEnterNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterEnterNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onLeaveNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterLeaveNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onExpose :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterExpose :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onExposeRect :: WidgetClass w => w -> (Rectangle -> IO ()) -> IO (ConnectId w)
afterExposeRect :: WidgetClass w => w -> (Rectangle -> IO ()) -> IO (ConnectId w)
onFocus :: WidgetClass w => w -> (DirectionType -> IO Bool) -> IO (ConnectId w)
afterFocus :: WidgetClass w => w -> (DirectionType -> IO Bool) -> IO (ConnectId w)
onFocusIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterFocusIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onFocusOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterFocusOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onGrabFocus :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterGrabFocus :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onDestroy :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterDestroy :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onHide :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterHide :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onHierarchyChanged :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterHierarchyChanged :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onKeyPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterKeyPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onKeyRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterKeyRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onMnemonicActivate :: WidgetClass w => w -> (Bool -> IO Bool) -> IO (ConnectId w)
afterMnemonicActivate :: WidgetClass w => w -> (Bool -> IO Bool) -> IO (ConnectId w)
onMotionNotify :: WidgetClass w => w -> Bool -> (Event -> IO Bool) -> IO (ConnectId w)
afterMotionNotify :: WidgetClass w => w -> Bool -> (Event -> IO Bool) -> IO (ConnectId w)
onParentSet :: (WidgetClass w, WidgetClass old) => w -> (old -> IO ()) -> IO (ConnectId w)
afterParentSet :: (WidgetClass w, WidgetClass old) => w -> (old -> IO ()) -> IO (ConnectId w)
onPopupMenu :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterPopupMenu :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onProximityIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterProximityIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onProximityOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterProximityOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onRealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterRealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onScroll :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterScroll :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onShow :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterShow :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onSizeAllocate :: WidgetClass w => w -> (Allocation -> IO ()) -> IO (ConnectId w)
afterSizeAllocate :: WidgetClass w => w -> (Allocation -> IO ()) -> IO (ConnectId w)
onSizeRequest :: WidgetClass w => w -> IO Requisition -> IO (ConnectId w)
afterSizeRequest :: WidgetClass w => w -> IO Requisition -> IO (ConnectId w)
onStateChanged :: WidgetClass w => w -> (StateType -> IO ()) -> IO (ConnectId w)
afterStateChanged :: WidgetClass w => w -> (StateType -> IO ()) -> IO (ConnectId w)
onUnmap :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterUnmap :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onUnrealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterUnrealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onVisibilityNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterVisibilityNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onWindowState :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterWindowState :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
Detail

The base class for all widgets. While a widget cannot be created directly, this module contains many useful methods common to all widgets. In particular, these functions are needed to add functionality to blank widgets such as DrawingArea or Layout.

Widget introduces style properties - these are basically object properties that are stored not on the object, but in the style object associated to the widget. Style properties are set in resource files. This mechanism is used for configuring such things as the location of the scrollbar arrows through the theme, giving theme authors more control over the look of applications without the need to write a theme engine in C.

Widgets receive events, that is, signals that indicate some low-level user iteraction. The signal handlers for all these events have to return True if the signal has been dealt with and False if other signal handlers should be run.

Class Hierarchy
 |  GObject
 |   +----Object
 |         +----Widget
 |               +----too many to list
 
Types
data Widget
show/hide Instances
class ObjectClass o => WidgetClass o
show/hide Instances
WidgetClass AboutDialog
WidgetClass AccelLabel
WidgetClass Alignment
WidgetClass Arrow
WidgetClass AspectFrame
WidgetClass Bin
WidgetClass Box
WidgetClass Button
WidgetClass ButtonBox
WidgetClass CList
WidgetClass CTree
WidgetClass Calendar
WidgetClass CellView
WidgetClass CheckButton
WidgetClass CheckMenuItem
WidgetClass ColorButton
WidgetClass ColorSelection
WidgetClass ColorSelectionDialog
WidgetClass Combo
WidgetClass ComboBox
WidgetClass ComboBoxEntry
WidgetClass Container
WidgetClass Dialog
WidgetClass DrawingArea
WidgetClass Entry
WidgetClass EventBox
WidgetClass Expander
WidgetClass FileChooserButton
WidgetClass FileChooserDialog
WidgetClass FileChooserWidget
WidgetClass FileSelection
WidgetClass Fixed
WidgetClass FontButton
WidgetClass FontSelection
WidgetClass FontSelectionDialog
WidgetClass Frame
WidgetClass GLDrawingArea
WidgetClass HBox
WidgetClass HButtonBox
WidgetClass HPaned
WidgetClass HRuler
WidgetClass HScale
WidgetClass HScrollbar
WidgetClass HSeparator
WidgetClass HandleBox
WidgetClass IconView
WidgetClass Image
WidgetClass ImageMenuItem
WidgetClass InputDialog
WidgetClass Invisible
WidgetClass Item
WidgetClass Label
WidgetClass Layout
WidgetClass List
WidgetClass ListItem
WidgetClass Menu
WidgetClass MenuBar
WidgetClass MenuItem
WidgetClass MenuShell
WidgetClass MenuToolButton
WidgetClass MessageDialog
WidgetClass Misc
WidgetClass Notebook
WidgetClass OptionMenu
WidgetClass Paned
WidgetClass Plug
WidgetClass Preview
WidgetClass ProgressBar
WidgetClass RadioButton
WidgetClass RadioMenuItem
WidgetClass RadioToolButton
WidgetClass Range
WidgetClass Ruler
WidgetClass Scale
WidgetClass Scrollbar
WidgetClass ScrolledWindow
WidgetClass Separator
WidgetClass SeparatorMenuItem
WidgetClass SeparatorToolItem
WidgetClass Socket
WidgetClass SourceView
WidgetClass SpinButton
WidgetClass Statusbar
WidgetClass Table
WidgetClass TearoffMenuItem
WidgetClass TextView
WidgetClass TipsQuery
WidgetClass ToggleButton
WidgetClass ToggleToolButton
WidgetClass ToolButton
WidgetClass ToolItem
WidgetClass Toolbar
WidgetClass TreeView
WidgetClass VBox
WidgetClass VButtonBox
WidgetClass VPaned
WidgetClass VRuler
WidgetClass VScale
WidgetClass VScrollbar
WidgetClass VSeparator
WidgetClass Viewport
WidgetClass Widget
WidgetClass Window
castToWidget :: GObjectClass obj => obj -> Widget
toWidget :: WidgetClass o => o -> Widget
data EventMask
Specify which events a widget will emit signals on.
Constructors
ExposureMask
PointerMotionMask
PointerMotionHintMask
ButtonMotionMask
Button1MotionMask
Button2MotionMask
Button3MotionMask
ButtonPressMask
ButtonReleaseMask
KeyPressMask
KeyReleaseMask
EnterNotifyMask
LeaveNotifyMask
FocusChangeMask
StructureMask
PropertyChangeMask
VisibilityNotifyMask
ProximityInMask
ProximityOutMask
SubstructureMask
ScrollMask
AllEventsMask
show/hide Instances
data ExtensionMode
specify which input extension a widget desires
Constructors
ExtensionEventsNone
ExtensionEventsAll
ExtensionEventsCursor
show/hide Instances
type GType = CULong
type KeyVal = Word32
Key values are the codes which are sent whenever a key is pressed or released.
data Region
show/hide Instances
Show Region
type Bitmap = Pixmap
A Bitmap is a special Pixmap in that the number of bits per pixel is one, that is, a pixel is either set or unset. Whenever a function expects a Bitmap, a Pixmap of depth one must be supplied.
data Requisition

Requisition

  • For widgetSizeRequest. The values represent the desired width and height of the widget.
Constructors
Requisition Int Int
show/hide Instances
data Rectangle

Rectangle

  • for Events
  • Specifies x, y, width and height
Constructors
Rectangle Int Int Int Int
show/hide Instances
data Color

Color

  • Specifies a color with three integer values for red, green and blue. All values range from 0 (least intense) to 65535 (highest intensity).
show/hide Instances
Eq Color
Show Color
Storable Color
data IconSize

The size of an icon in pixels.

  • This enumeration contains one case that is not exported and which is used when new sizes are registered using iconSizeRegister.
  • Applying show to this type will reveal the name of the size that is registered with Gtk+.
Constructors
IconSizeInvalidDon't scale but use any of the available sizes.
IconSizeMenuIcon size to use in next to menu items in drop-down menus.
IconSizeSmallToolbarIcon size for small toolbars.
IconSizeLargeToolbarIcon size for larger toolbars.
IconSizeButtonIcon size for icons in buttons, next to the label.
IconSizeDndIcon size for icons in drag-and-drop.
IconSizeDialogIcon size for icons next to dialog text.
IconSizeUser Int
show/hide Instances
data StateType
Widget states
Constructors
StateNormal
StateActive
StatePrelight
StateSelected
StateInsensitive
show/hide Instances
data TextDirection
Is the text written from left to right or the exotic way?
Constructors
TextDirNone
TextDirLtr
TextDirRtl
show/hide Instances
data AccelFlags
State of an accelerator
Constructors
AccelVisible
AccelLocked
AccelMask
show/hide Instances
data DirectionType
Editing direction
Constructors
DirTabForward
DirTabBackward
DirUp
DirDown
DirLeft
DirRight
show/hide Instances
type StockId = String
A synonym for a standard button or icon.
data WidgetHelpType
Specify what kind of help the user wants.
Constructors
WidgetHelpTooltip
WidgetHelpWhatsThis
show/hide Instances
Methods
widgetShow :: WidgetClass self => self -> IO ()

Flags a widget to be displayed. Any widget that isn't shown will not appear on the screen. If you want to show all the widgets in a container, it's easier to call widgetShowAll on the container, instead of individually showing the widgets.

Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen.

When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.

widgetShowNow :: WidgetClass self => self -> IO ()
Shows a widget. If the widget is an unmapped toplevel widget (i.e. a Window that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function.
widgetHide :: WidgetClass self => self -> IO ()
Reverses the effects of widgetShow, causing the widget to be hidden (invisible to the user).
widgetShowAll :: WidgetClass self => self -> IO ()
Recursively shows a widget, and any child widgets (if the widget is a container).
widgetHideAll :: WidgetClass self => self -> IO ()
Recursively hides a widget and any child widgets.
widgetDestroy :: WidgetClass self => self -> IO ()

Destroys a widget. Equivalent to objectDestroy.

When a widget is destroyed it will be removed from the screen and unrealized. When a widget is destroyed, it will break any references it holds to other objects.If the widget is inside a container, the widget will be removed from the container. The widget will be garbage collected (finalized) time after your last reference to the widget dissapears.

In most cases, only toplevel widgets (windows) require explicit destruction, because when you destroy a toplevel its children will be destroyed as well.

widgetQueueDraw :: WidgetClass self => self -> IO ()
Send a redraw request to a widget. Equivalent to calling widgetQueueDrawArea for the entire area of a widget.
widgetQueueResize :: WidgetClass self => self -> IO ()
This function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a Label, Label queues a resize to ensure there's enough space for the new text.
widgetQueueResizeNoRedraw :: WidgetClass self => self -> IO ()

This function works like widgetQueueResize, except that the widget is not invalidated.

  • Available since Gtk+ version 2.4
widgetSizeRequest :: WidgetClass self => self -> IO Requisition

This function is typically used when implementing a Container subclass. Obtains the preferred size of a widget. The container uses this information to arrange its child widgets and decide what size allocations to give them with widgetSizeAllocate.

You can also call this function from an application, with some caveats. Most notably, getting a size request requires the widget to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind.

Also remember that the size request is not necessarily the size a widget will actually be allocated.

widgetGetChildRequisition :: WidgetClass self => self -> IO Requisition

This function is only for use in widget implementations. Obtains the chached requisition information in the widget, unless someone has forced a particular geometry on the widget (e.g. with widgetSetUsize), in which case it returns that geometry instead of the widget's requisition.

This function differs from widgetSizeRequest in that it retrieves the last size request value stored in the widget, while widgetSizeRequest actually emits the sizeRequest signal on the widget to compute the size request (which updates the widget's requisition information).

Since this function does not emit the sizeRequest signal, it can only be used when you know that the widget's requisition is up-to-date, that is, widgetSizeRequest has been called since the last time a resize was queued. In general, only container implementations have this information; applications should use widgetSizeRequest.

widgetSizeAllocate
:: WidgetClass self
=> self
-> AllocationThe x and y values of the rectangle determine the the position of the widget's area relative to its parent allocation.
-> IO ()
This function is only used by Container subclasses, to assign a size and position to their child widgets.
widgetAddAccelerator
:: WidgetClass self
=> self
-> StringaccelSignal - widget signal to emit on accelerator activation
-> AccelGroupaccelGroup - accel group for this widget, added to its toplevel
-> KeyValaccelKey - the key of the accelerator
-> [Modifier]accelMods - modifier key combination of the accelerator
-> [AccelFlags]accelFlags - flag accelerators, e.g. AccelVisible
-> IO ()
Installs an accelerator for this widget in accelGroup that causes accelSignal to be emitted if the accelerator is activated. The accelGroup needs to be added to the widget's toplevel via windowAddAccelGroup, and the signal must be of type G_RUN_ACTION. Accelerators added through this function are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use accelMapAddEntry and widgetSetAccelPath or menuItemSetAccelPath instead.
widgetRemoveAccelerator
:: WidgetClass self
=> self
-> AccelGroupaccelGroup - accel group for this widget
-> KeyValaccelKey - the key of the accelerator
-> [Modifier]accelMods - modifier key combination of the accelerator
-> IO Boolreturns whether an accelerator was installed and could be removed
Removes an accelerator from widget, previously installed with widgetAddAccelerator.
widgetSetAccelPath
:: WidgetClass self
=> self
-> StringaccelPath - path used to look up the accelerator
-> AccelGroupaccelGroup - a AccelGroup.
-> IO ()

Given an accelerator group, accelGroup, and an accelerator path, accelPath, sets up an accelerator in accelGroup so whenever the key binding that is defined for accelPath is pressed, widget will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to widgetSetAccelPath. Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See accelMapSave.)

This function is a low level function that would most likely be used by a menu creation system like ItemFactory. If you use ItemFactory, setting up accelerator paths will be done automatically.

Even when you you aren't using ItemFactory, if you only want to set up accelerators on menu items menuItemSetAccelPath provides a somewhat more convenient interface.

widgetCanActivateAccel
:: WidgetClass self
=> ConnectId selfsignalId - the ID of a signal installed on widget
-> IO Boolreturns True if the accelerator can be activated.

Determines whether an accelerator that activates the signal identified by signalId can currently be activated. This is done by emitting the canActivateAccel signal on the widget the signal is attached to; if the signal isn't overridden by a handler or in a derived widget, then the default check is that the widget must be sensitive, and the widget and all its ancestors mapped.

  • Available since Gtk+ version 2.4
widgetActivate
:: WidgetClass self
=> self
-> IO Boolreturns True if the widget was activatable
For widgets that can be "activated" (buttons, menu items, etc.) this function activates them. Activation is what happens when you press Enter on a widget during key navigation. If widget isn't activatable, the function returns False.
widgetIntersect
:: WidgetClass self
=> self
-> Rectanglearea - a rectangle
-> IO (Maybe Rectangle)returns the intersection or Nothing
Computes the intersection of a widget's area and area, returning the intersection, and returns Nothing if there was no intersection.
widgetHasIntersection
:: WidgetClass self
=> self
-> Rectanglearea - a rectangle
-> IO Boolreturns True if there was an intersection
Check if the widget intersects with a given area.
widgetGetIsFocus
:: WidgetClass self
=> self
-> IO Boolreturns True if the widget is the focus widget.
Determines if the widget is the focus widget within its toplevel. (This does not mean that the widgetHasFocus attribute is necessarily set; widgetHasFocus will only be set if the toplevel widget additionally has the global input focus.)
widgetGrabFocus :: WidgetClass self => self -> IO ()
Causes widget to have the keyboard focus for the Window it's inside. widget must be a focusable widget, such as a Entry; something like Frame won't work. (More precisely, it must have the widgetCanFocus flag set.)
widgetGrabDefault :: WidgetClass self => self -> IO ()
Causes widget to become the default widget. widget must have the canDefault flag set. The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, widgetActivate should affect them.
widgetSetName
:: WidgetClass self
=> self
-> Stringname - name for the widget
-> IO ()

Widgets can be named, which allows you to refer to them from a gtkrc file. You can apply a style to widgets with a particular name in the gtkrc file. See the documentation for gtkrc files.

Note that widget names are separated by periods in paths (see widgetPath), so names with embedded periods may cause confusion.

widgetGetName :: WidgetClass self => self -> IO String
Retrieves the name of a widget. See widgetSetName for the significance of widget names.
widgetSetSensitive
:: WidgetClass self
=> self
-> Boolsensitive - True to make the widget sensitive
-> IO ()
Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are "grayed out" and the user can't interact with them. Insensitive widgets are known as "inactive", "disabled", or "ghosted" in some other toolkits.
widgetSetSensitivity :: WidgetClass self => self -> Bool -> IO ()
widgetGetParentWindow :: WidgetClass self => self -> IO DrawWindow
Gets the widget's parent window.
widgetGetDrawWindow :: WidgetClass widget => widget -> IO DrawWindow

Retrieves the DrawWindow that the widget draws onto.

This may be Nothing if the widget has not yet been realized, since a widget does not allocate its window resources until just before it is displayed on the screen. You can use the onRealize signal to give you the opportunity to use a widget's DrawWindow as soon as it has been created but before the widget is displayed.

widgetDelEvents :: WidgetClass self => self -> [EventMask] -> IO ()

Disable event signals.

  • Remove events from the EventMask of this widget. The event mask determines which events a widget will receive. Events are signals that return an Event data type. On connecting to a such a signal, the event mask is automatically adjusted so that he signal is emitted. This function is useful to disable the reception of the signal. It should be called whenever all signals receiving an Event have been disconected.
widgetAddEvents :: WidgetClass self => self -> [EventMask] -> IO ()

Enable event signals.

widgetGetEvents :: WidgetClass self => self -> IO [EventMask]

Get enabled event signals.

widgetSetEvents
:: WidgetClass self
=> self
-> [EventMask]events - event mask
-> IO ()
Sets the event mask (see EventMask) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget's functionality, so be careful. This function must be called while a widget is unrealized. Consider widgetAddEvents for widgets that are already realized, or if you want to preserve the existing event mask. This function can't be used with NoWindow widgets; to get events on those widgets, place them inside a EventBox and receive events on the event box.
widgetSetExtensionEvents :: WidgetClass self => self -> [ExtensionMode] -> IO ()
Sets the extension events mask to mode. See ExtensionMode and inputSetExtensionEvents.
widgetGetExtensionEvents :: WidgetClass self => self -> IO [ExtensionMode]
Retrieves the extension events the widget will receive; see widgetSetExtensionEvents.
widgetGetToplevel
:: WidgetClass self
=> selfwidget - the widget in question
-> IO Widgetreturns the topmost ancestor of widget, or widget itself if there's no ancestor.
This function returns the topmost widget in the container hierarchy widget is a part of. If widget has no parent widgets, it will be returned as the topmost widget.
widgetGetAncestor
:: WidgetClass self
=> self
-> GTypewidgetType - ancestor type
-> IO (Maybe Widget)returns the ancestor widget, or Nothing if not found

Gets the first ancestor of widget with type widgetType. For example, widgetGetAncestor widget gTypeBox gets the first Box that's an ancestor of widget. See note about checking for a toplevel Window in the docs for widgetGetToplevel.

Note that unlike widgetIsAncestor, widgetGetAncestor considers widget to be an ancestor of itself.

widgetGetColormap
:: WidgetClass self
=> self
-> IO Colormapreturns the colormap used by widget
Gets the colormap that will be used to render widget.
widgetSetColormap
:: WidgetClass self
=> self
-> Colormapcolormap - a colormap
-> IO ()
Sets the colormap for the widget to the given value. Widget must not have been previously realized. This probably should only be used from an init function (i.e. from the constructor for the widget).
widgetGetPointer
:: WidgetClass self
=> self
-> IO (Int, Int)(x, y) - X Y coordinate
Obtains the location of the mouse pointer in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as widgetGetParentWindow coordinates for widgets that are not NoWindow widgets, and are relative to the widget's allocation's (x,y) for widgets that are NoWindow widgets.
widgetIsAncestor
:: (WidgetClass self, WidgetClass ancestor)
=> selfwidget - the widget in question
-> ancestorancestor - another Widget
-> IO Boolreturns True if ancestor contains widget as a child, grandchild, great grandchild, etc.
Determines whether widget is somewhere inside ancestor, possibly with intermediate containers.
widgetTranslateCoordinates
:: (WidgetClass self, WidgetClass destWidget)
=> selfsrcWidget - a Widget
-> destWidgetdestWidget - a Widget
-> IntsrcX - X position relative to srcWidget
-> IntsrcY - Y position relative to srcWidget
-> IO (Maybe (Int, Int))Just (destX, destY) - X and Y position relative to destWidget. Returns Nothing if either widget was not realized, or there was no common ancestor.
Translate coordinates relative to srcWidget's allocation to coordinates relative to destWidget's allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel.
widgetSetStyle
:: WidgetClass self
=> self
-> Maybe Stylestyle - a Style, or Nothing to remove the effect of a previous widgetSetStyle and go back to the default style
-> IO ()
Sets the Style for a widget. You probably don't want to use this function; it interacts badly with themes, because themes work by replacing the Style. Instead, use widgetModifyStyle.
widgetGetStyle :: WidgetClass widget => widget -> IO Style
Retrieve the Style associated with the widget.
widgetPushColormap
:: Colormapcmap - a Colormap
-> IO ()
Pushes cmap onto a global stack of colormaps; the topmost colormap on the stack will be used to create all widgets. Remove cmap with widgetPopColormap. There's little reason to use this function.
widgetPopColormap :: IO ()
Removes a colormap pushed with widgetPushColormap.
widgetSetDefaultColormap
:: Colormapcolormap - a Colormap
-> IO ()
Sets the default colormap to use when creating widgets. widgetPushColormap is a better function to use if you only want to affect a few widgets, rather than all widgets.
widgetGetDefaultStyle
:: IO Stylereturns the default style. This Style object is owned by Gtk and should not be modified.
Returns the default style used by all widgets initially.
widgetGetDefaultColormap
:: IO Colormapreturns default widget colormap
Obtains the default colormap used to create widgets.
widgetSetDirection :: WidgetClass self => self -> TextDirection -> IO ()

Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitely visual rather than logical (such as buttons for text justification).

If the direction is set to TextDirNone, then the value set by widgetSetDefaultDirection will be used.

widgetGetDirection :: WidgetClass self => self -> IO TextDirection
Gets the reading direction for a particular widget. See widgetSetDirection.
widgetSetDefaultDirection
:: TextDirectiondir - the new default direction. This cannot be TextDirNone.
-> IO ()
Sets the default reading direction for widgets where the direction has not been explicitly set by widgetSetDirection.
widgetGetDefaultDirection :: IO TextDirection
Obtains the current default reading direction. See widgetSetDefaultDirection.
widgetShapeCombineMask
:: WidgetClass self
=> self
-> Maybe BitmapshapeMask - shape to be added, or Nothint to remove an existing shape.
-> IntoffsetX - X position of shape mask with respect to window.
-> IntoffsetY - Y position of shape mask with respect to window.
-> IO ()
Sets a shape for this widget's DrawWindow. This allows for transparent windows etc., see windowShapeCombineMask for more information.
widgetInputShapeCombineMask
:: WidgetClass self
=> self
-> Maybe BitmapshapeMask - shape to be added, or Nothint to remove an existing shape.
-> IntoffsetX - X position of shape mask with respect to window.
-> IntoffsetY - Y position of shape mask with respect to window.
-> IO ()

Sets an input shape for this widget's GDK window. This allows for windows which react to mouse click in a nonrectangular region, see windowInputShapeCombineMask for more information.

  • Available since Gtk+ version 2.10
widgetPath
:: WidgetClass self
=> self
-> IO (Int, String, String)(pathLength, path, pathReversed) - length of the path, path string and reverse path string
Obtains the full path to widget. The path is simply the name of a widget and all its parents in the container hierarchy, separated by periods. The name of a widget comes from widgetGetName. Paths are used to apply styles to a widget in gtkrc configuration files. Widget names are the type of the widget by default (e.g. "GtkButton") or can be set to an application-specific value with widgetSetName. By setting the name of a widget, you allow users or theme authors to apply styles to that specific widget in their gtkrc file. Also returns the path in reverse order, i.e. starting with the widget's name instead of starting with the name of the widget's outermost ancestor.
widgetClassPath
:: WidgetClass self
=> self
-> IO (Int, String, String)(pathLength, path, pathReversed) - length of the path, path string and reverse path string
Same as widgetPath, but always uses the name of a widget's type, never uses a custom name set with widgetSetName.
widgetGetCompositeName
:: WidgetClass self
=> self
-> IO (Maybe String)returns the composite name of widget, or Nothing if widget is not a composite child.
Obtains the composite name of a widget.
widgetModifyStyle
:: (WidgetClass self, RcStyleClass style)
=> self
-> stylestyle - the RcStyle holding the style modifications
-> IO ()

Modifies style values on the widget. Modifications made using this technique take precedence over style values set via an RC file, however, they will be overriden if a style is explicitely set on the widget using widgetSetStyle. The RcStyle structure is designed so each field can either be set or unset, so it is possible, using this function, to modify some style values and leave the others unchanged.

Note that modifications made with this function are not cumulative with previous calls to widgetModifyStyle or with such functions as widgetModifyFg. If you wish to retain previous values, you must first call widgetGetModifierStyle, make your modifications to the returned style, then call widgetModifyStyle with that style. On the other hand, if you first call widgetModifyStyle, subsequent calls to such functions widgetModifyFg will have a cumulative effect with the initial modifications.

widgetGetModifierStyle :: WidgetClass self => self -> IO RcStyle

Returns the current modifier style for the widget. (As set by widgetModifyStyle.) If no style has previously set, a new RcStyle will be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must call widgetModifyStyle, passing in the returned rc style, to make sure that your changes take effect.

Caution: passing the style back to widgetModifyStyle will normally end up destroying it, because widgetModifyStyle copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.

widgetModifyFg
:: WidgetClass self
=> self
-> StateTypestate - the state for which to set the foreground color.
-> Colorcolor - the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyFg.
-> IO ()
Sets the foreground color for a widget in a particular state. All other style values are left untouched. See also widgetModifyStyle.
widgetModifyBg
:: WidgetClass self
=> self
-> StateTypestate - the state for which to set the background color.
-> Colorcolor - the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyBg.
-> IO ()

Sets the background color for a widget in a particular state. All other style values are left untouched. See also widgetModifyStyle.

Note that "no window" widgets (which have the NoWindow flag set) draw on their parent container's window and thus may not draw any background themselves. This is the case for e.g. Label. To modify the background of such widgets, you have to set the background color on their parent; if you want to set the background of a rectangular area around a label, try placing the label in a EventBox widget and setting the background color on that.

widgetModifyText
:: WidgetClass self
=> self
-> StateTypestate - the state for which to set the text color.
-> Colorcolor - the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyText.
-> IO ()
Sets the text color for a widget in a particular state. All other style values are left untouched. The text color is the foreground color used along with the base color (see widgetModifyBase) for widgets such as Entry and TextView. See also widgetModifyStyle.
widgetModifyBase
:: WidgetClass self
=> self
-> StateTypestate - the state for which to set the base color.
-> Colorcolor - the color to assign (does not need to be allocated), or Nothing to undo the effect of previous calls to of widgetModifyBase.
-> IO ()

Sets the base color for a widget in a particular state. All other style values are left untouched. The base color is the background color used along with the text color (see widgetModifyText) for widgets such as Entry and TextView. See also widgetModifyStyle.

Note that "no window" widgets (which have the NoWindow flag set) draw on their parent container's window and thus may not draw any background themselves. This is the case for e.g. Label. To modify the background of such widgets, you have to set the base color on their parent; if you want to set the background of a rectangular area around a label, try placing the label in a EventBox widget and setting the base color on that.

widgetModifyFont
:: WidgetClass self
=> self
-> Maybe FontDescriptionfontDesc - the font description to use, or Nothing to undo the effect of previous calls to widgetModifyFont.
-> IO ()
Sets the font to use for a widget. All other style values are left untouched. See also widgetModifyStyle.
widgetCreatePangoContext
:: WidgetClass self
=> self
-> IO PangoContextreturns the new PangoContext
Creates a new PangoContext with the appropriate colormap, font description, and base direction for drawing text for this widget. See also widgetGetPangoContext.
widgetGetPangoContext
:: WidgetClass self
=> self
-> IO PangoContextreturns the PangoContext for the widget.

Gets a PangoContext with the appropriate font description and base direction for this widget. Unlike the context returned by widgetCreatePangoContext, this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget's attributes.

If you create and keep a PangoLayout using this context, you must deal with changes to the context by calling layoutContextChanged on the layout in response to the onStyleChanged and onDirectionChanged signals for the widget.

widgetCreateLayout
:: WidgetClass self
=> self
-> Stringtext - text to set on the layout
-> IO PangoLayout

Prepare text for display.

The PangoLayout represents the rendered text. It can be shown on screen by calling drawLayout.

The returned PangoLayout shares the same font information (PangoContext) as this widget. If this information changes, the PangoLayout should change. The following code ensures that the displayed text always reflects the widget's settings:

 l <- widgetCreateLayout w "My Text."
 let update = do
                layoutContextChanged l
 		    -- update the Drawables which show this layout
 w `onDirectionChanged` update
 w `onStyleChanged` update
widgetRenderIcon
:: WidgetClass self
=> self
-> StringstockId - a stock ID
-> IconSizesize - a stock size
-> Stringdetail - render detail to pass to theme engine
-> IO (Maybe Pixbuf)returns a new pixbuf, or Nothing if the stock ID wasn't known

A convenience function that uses the theme engine and RC file settings for widget to look up the stock icon and render it to a Pixbuf. The icon should be one of the stock id constants such as stockOpen. size should be a size such as IconSizeMenu. detail should be a string that identifies the widget or code doing the rendering, so that theme engines can special-case rendering for that widget or code.

The pixels in the returned Pixbuf are shared with the rest of the application and should not be modified.

widgetQueueDrawArea
:: WidgetClass self
=> self
-> Intx - x coordinate of upper-left corner of rectangle to redraw
-> Inty - y coordinate of upper-left corner of rectangle to redraw
-> Intwidth - width of region to draw
-> Intheight - height of region to draw
-> IO ()

Invalidates the rectangular area of widget defined by x, y, width and height by calling drawWindowInvalidateRect on the widget's DrawWindow and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated.

Normally you would only use this function in widget implementations. In particular, you might use it, or drawWindowInvalidateRect directly, to schedule a redraw of a DrawingArea or some portion thereof.

Frequently you can just call windowInvalidateRect or windowInvalidateRegion instead of this function. Those functions will invalidate only a single window, instead of the widget and all its children.

The advantage of adding to the invalidated region compared to simply drawing immediately is efficiency; using an invalid region ensures that you only have to redraw one time.

widgetResetShapes :: WidgetClass self => self -> IO ()
Recursively resets the shape on this widget and its descendants.
widgetSetAppPaintable
:: WidgetClass self
=> self
-> BoolappPaintable - True if the application will paint on the widget
-> IO ()

Sets whether the application intends to draw on the widget in response to an onExpose signal.

  • This is a hint to the widget and does not affect the behavior of the GTK+ core; many widgets ignore this flag entirely. For widgets that do pay attention to the flag, such as EventBox and Window, the effect is to suppress default themed drawing of the widget's background. (Children of the widget will still be drawn.) The application is then entirely responsible for drawing the widget background.
widgetSetDoubleBuffered
:: WidgetClass self
=> self
-> BooldoubleBuffered - True to double-buffer a widget
-> IO ()

Widgets are double buffered by default; you can use this function to turn off the buffering. "Double buffered" simply means that drawWindowBeginPaintRegion and drawWindowEndPaint are called automatically around expose events sent to the widget. drawWindowBeginPaintRegion diverts all drawing to a widget's window to an offscreen buffer, and drawWindowEndPaint draws the buffer to the screen. The result is that users see the window update in one smooth step, and don't see individual graphics primitives being rendered.

In very simple terms, double buffered widgets don't flicker, so you would only use this function to turn off double buffering if you had special needs and really knew what you were doing.

Note: if you turn off double-buffering, you have to handle expose events, since even the clearing to the background color or pixmap will not happen automatically (as it is done in drawWindowBeginPaint).

widgetSetRedrawOnAllocate
:: WidgetClass self
=> self
-> BoolredrawOnAllocate - if True, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
-> IO ()

Sets whether the entire widget is queued for drawing when its size allocation changes. By default, this setting is True and the entire widget is redrawn on every size change. If your widget leaves the upper left unchanged when made bigger, turning this setting on will improve performance.

Note that for "no window" widgets setting this flag to False turns off all allocation on resizing: the widget will not even redraw if its position changes; this is to allow containers that don't draw anything to avoid excess invalidations. If you set this flag on a "no window" widget that does draw its window, you are responsible for invalidating both the old and new allocation of the widget when the widget is moved and responsible for invalidating regions newly when the widget increases size.

widgetSetCompositeName
:: WidgetClass self
=> self
-> Stringname - the name to set.
-> IO ()
Sets a widgets composite name. A child widget of a container is composite if it serves as an internal widget and, thus, is not added by the user.
widgetSetScrollAdjustments
:: WidgetClass self
=> self
-> Maybe Adjustmenthadjustment - an adjustment for horizontal scrolling, or Nothing
-> Maybe Adjustmentvadjustment - an adjustment for vertical scrolling, or Nothing
-> IO Boolreturns True if the widget supports scrolling
For widgets that support scrolling, sets the scroll adjustments and returns True. For widgets that don't support scrolling, does nothing and returns False. Widgets that don't support scrolling can be scrolled by placing them in a Viewport, which does support scrolling.
widgetRegionIntersect
:: WidgetClass self
=> self
-> Regionregion - a Region in the same coordinate system as the widget's allocation. That is, relative to the widget's DrawWindow for NoWindow widgets; relative to the parent DrawWindow of the widget's DrawWindow for widgets with their own DrawWindow.
-> IO Regionreturns A region holding the intersection of the widget and region. The coordinates of the return value are relative to the widget's DrawWindow, if it has one, otherwise it is relative to the parent's DrawWindow.
Computes the intersection of a widget's area and region, returning the intersection. The result may be empty, use regionEmpty to check.
widgetGetAccessible
:: WidgetClass self
=> self
-> IO Objectreturns the Object associated with widget

Returns the accessible object that describes the widget to an assistive technology.

If no accessibility library is loaded (i.e. no ATK implementation library is loaded via GTK_MODULES or via another application library, such as libgnome), then this Object instance may be a no-op. Likewise, if no class-specific Object implementation is available for the widget instance in question, it will inherit an Object implementation from the first ancestor class for which such an implementation is defined.

The documentation of the ATK library contains more information about accessible objects and their uses.

widgetChildFocus
:: WidgetClass self
=> self
-> DirectionTypedirection - direction of focus movement
-> IO Boolreturns True if focus ended up inside widget

This function is used by custom widget implementations; if you're writing an app, you'd use widgetGrabFocus to move the focus to a particular widget, and containerSetFocusChain to change the focus tab order. So you may want to investigate those functions instead.

The "focus" default handler for a widget should return True if moving in direction left the focus on a focusable location inside that widget, and False if moving in direction moved the focus outside the widget. If returning True, widgets normally call widgetGrabFocus to place the focus accordingly; if returning False, they don't modify the current focus location.

widgetGetChildVisible
:: WidgetClass self
=> self
-> IO Boolreturns True if the widget is mapped with the parent.

Gets the value set with widgetSetChildVisible. If you feel a need to use this function, your code probably needs reorganization.

This function is only useful for container implementations and never should be called by an application.

widgetGetParent :: WidgetClass self => self -> IO (Maybe Widget)

Returns the parent container of widget.

  • Returns the parent container of widget if it has one.
widgetGetSettings
:: WidgetClass self
=> self
-> IO Settingsreturns the relevant Settings object

Gets the settings object holding the settings (global property settings, RC file information, etc) used for this widget.

Note that this function can only be called when the Widget is attached to a toplevel, since the settings object is specific to a particular Screen.

widgetGetDisplay
:: WidgetClass self
=> self
-> IO Displayreturns the Display for the toplevel for this widget.

Get the Display for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top.

In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

  • Available since Gtk+ version 2.2
widgetGetRootWindow
:: WidgetClass self
=> self
-> IO DrawWindowreturns the DrawWindow root window for the toplevel for this widget.

Get the root window where this widget is located. This function can only be called after the widget has been added to a widget heirarchy with Window at the top.

The root window is useful for such purposes as creating a popup DrawWindow associated with the window. In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

  • Available since Gtk+ version 2.2
widgetGetScreen
:: WidgetClass self
=> self
-> IO Screenreturns the Screen for the toplevel for this widget.

Get the Screen from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top.

In general, you should only create screen specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

  • Available since Gtk+ version 2.2
widgetHasScreen
:: WidgetClass self
=> self
-> IO Boolreturns True if there is a Screen associcated with the widget.

Checks whether there is a Screen is associated with this widget. All toplevel widgets have an associated screen, and all widgets added into a heirarchy with a toplevel window at the top.

  • Available since Gtk+ version 2.2
widgetGetSizeRequest
:: WidgetClass self
=> self
-> IO (Int, Int)
(width, height)
Gets the size request that was explicitly set for the widget using widgetSetSizeRequest. A value of -1 for width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used intead. See widgetSetSizeRequest. To get the size a widget will actually use, call widgetSizeRequest instead of this function.
widgetSetChildVisible
:: WidgetClass self
=> self
-> BoolisVisible - if True, widget should be mapped along with its parent.
-> IO ()

Sets whether widget should be mapped along with its when its parent is mapped and widget has been shown with widgetShow.

The child visibility can be set for widget before it is added to a container with widgetSetParent, to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of True when the widget is removed from a container.

Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself.

This function is only useful for container implementations and never should be called by an application.

widgetSetSizeRequest
:: WidgetClass self
=> self
-> Intwidth - width widget should request, or -1 to unset
-> Intheight - height widget should request, or -1 to unset
-> IO ()

Sets the minimum size of a widget; that is, the widget's size request will be width by height. You can use this function to force a widget to be either larger or smaller than it normally would be.

In most cases, windowSetDefaultSize is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, windowSetGeometryHints can be a useful function as well.

Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct.

The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested.

If the size request in a given direction is -1 (unset), then the "natural" size request of the widget will be used instead.

Widgets can't actually be allocated a size less than 1 by 1, but you can pass 0,0 to this function to mean "as small as possible."

widgetSetNoShowAll
:: WidgetClass self
=> self
-> BoolnoShowAll - the new value for the noShowAll property
-> IO ()

Sets the noShowAll property, which determines whether calls to widgetShowAll and widgetHideAll will affect this widget.

This is mostly for use in constructing widget hierarchies with externally controlled visibility, see UIManager.

  • Available since Gtk+ version 2.4
widgetGetNoShowAll
:: WidgetClass self
=> self
-> IO Boolreturns the current value of the "no_show_all" property.

Returns the current value of the noShowAll property, which determines whether calls to widgetShowAll and widgetHideAll will affect this widget.

  • Available since Gtk+ version 2.4
widgetListMnemonicLabels
:: WidgetClass self
=> self
-> IO [Widget]returns the list of mnemonic labels

Returns a list of the widgets, normally labels, for which this widget is a the target of a mnemonic (see for example, labelSetMnemonicWidget).

  • Available since Gtk+ version 2.4
widgetAddMnemonicLabel
:: (WidgetClass self, WidgetClass label)
=> self
-> labellabel - a Widget that acts as a mnemonic label for widget.
-> IO ()

Adds a widget to the list of mnemonic labels for this widget. (See widgetListMnemonicLabels). Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well, by using a connection to the destroy signal or a weak notifier.

  • Available since Gtk+ version 2.4
widgetRemoveMnemonicLabel
:: (WidgetClass self, WidgetClass label)
=> self
-> labellabel - a Widget that was previously set as a mnemnic label for widget with widgetAddMnemonicLabel.
-> IO ()

Removes a widget from the list of mnemonic labels for this widget. (See widgetListMnemonicLabels). The widget must have previously been added to the list with widgetAddMnemonicLabel.

  • Available since Gtk+ version 2.4
widgetGetAction
:: WidgetClass self
=> self
-> IO (Maybe Action)returns the action that a widget is a proxy for, or Nothing, if it is not attached to an action.

Returns the Action that widget is a proxy for. See also actionGetProxies.

  • Available since Gtk+ version 2.10
widgetIsComposited
:: WidgetClass self
=> self
-> IO Boolreturns True if the widget can rely on its alpha channel being drawn correctly.

Whether widget can rely on having its alpha channel drawn correctly. On X11 this function returns whether a compositing manager is running for widget's screen

  • Available since Gtk+ version 2.10
widgetReparent
:: (WidgetClass self, WidgetClass newParent)
=> self
-> newParentnewParent - a Container to move the widget into
-> IO ()
Moves a widget from one Container to another.
widgetGetCanFocus :: WidgetClass self => self -> IO Bool
Check if this widget can receive keyboard input.
widgetSetCanFocus :: WidgetClass self => self -> Bool -> IO ()

Set if this widget can receive keyboard input.

  • To use the onKeyPress event, the widget must be allowed to get the input focus. Once it has the input focus all keyboard input is directed to this widget.
widgetGetState :: WidgetClass w => w -> IO StateType

Retrieve the current state of the widget.

  • The state refers to different modes of user interaction, see StateType for more information.
widgetGetSavedState :: WidgetClass w => w -> IO StateType

Retrieve the current state of the widget.

  • If a widget is turned insensitive, the previous state is stored in a specific location. This function retrieves this previous state.
widgetGetSize :: WidgetClass widget => widget -> IO (Int, Int)

Returns the current size.

  • This information may be out of date if the user is resizing the window.
Attributes
widgetName :: WidgetClass self => Attr self (Maybe String)

The name of the widget.

Default value: Nothing

widgetParent :: (WidgetClass self, ContainerClass container) => ReadWriteAttr self (Maybe Container) (Maybe container)
The parent widget of this widget. Must be a Container widget.
widgetWidthRequest :: WidgetClass self => Attr self Int

Override for width request of the widget, or -1 if natural request should be used.

Allowed values: >= -1

Default value: -1

widgetHeightRequest :: WidgetClass self => Attr self Int

Override for height request of the widget, or -1 if natural request should be used.

Allowed values: >= -1

Default value: -1

widgetVisible :: WidgetClass self => Attr self Bool

Whether the widget is visible.

Default value: False

widgetSensitive :: WidgetClass self => Attr self Bool

Whether the widget responds to input.

Default value: True

widgetAppPaintable :: WidgetClass self => Attr self Bool

Whether the application will paint directly on the widget.

Default value: False

widgetCanFocus :: WidgetClass self => Attr self Bool

Whether the widget can accept the input focus.

Default value: False

widgetHasFocus :: WidgetClass self => Attr self Bool

Whether the widget has the input focus.

Default value: False

widgetIsFocus :: WidgetClass self => Attr self Bool

Whether the widget is the focus widget within the toplevel.

Default value: False

widgetCanDefault :: WidgetClass self => Attr self Bool

Whether the widget can be the default widget.

Default value: False

widgetHasDefault :: WidgetClass self => Attr self Bool

Whether the widget is the default widget.

Default value: False

widgetReceivesDefault :: WidgetClass self => Attr self Bool

If True, the widget will receive the default action when it is focused.

Default value: False

widgetCompositeChild :: WidgetClass self => ReadAttr self Bool

Whether the widget is part of a composite widget.

Default value: False

widgetStyle :: WidgetClass self => Attr self Style
The style of the widget, which contains information about how it will look (colors etc).
widgetEvents :: WidgetClass self => Attr self [EventMask]

The event mask that decides what kind of GdkEvents this widget gets.

Default value: StructureMask

widgetExtensionEvents :: WidgetClass self => Attr self [ExtensionMode]

The mask that decides what kind of extension events this widget gets.

Default value: ExtensionEventsNone

widgetNoShowAll :: WidgetClass self => Attr self Bool

Whether widgetShowAll should not affect this widget.

Default value: False

widgetChildVisible :: WidgetClass self => Attr self Bool
'childVisible' property. See widgetGetChildVisible and widgetSetChildVisible
widgetColormap :: WidgetClass self => Attr self Colormap
'colormap' property. See widgetGetColormap and widgetSetColormap
widgetCompositeName :: WidgetClass self => ReadWriteAttr self (Maybe String) String
'compositeName' property. See widgetGetCompositeName and widgetSetCompositeName
widgetDirection :: WidgetClass self => Attr self TextDirection
'direction' property. See widgetGetDirection and widgetSetDirection
Signals
realize :: WidgetClass self => Signal self (IO ())
The widget should allocate any resources needed, in particular, the widget's DrawWindow is created. If you connect to this signal and you rely on some of these resources to be present, you have to use after.
unrealize :: WidgetClass self => Signal self (IO ())
The widget should deallocate any resources. This signal is emitted before the widget is destroyed.
mapSignal :: WidgetClass self => Signal self (IO ())
The widget appears on screen.
unmapSignal :: WidgetClass self => Signal self (IO ())
The widget disappears from the screen.
sizeRequest :: WidgetClass self => Signal self (IO Requisition)

Query the widget for the size it likes to have.

  • A parent container emits this signal to its child to query the needed height and width of the child. There is not guarantee that the widget will actually get this area.
sizeAllocate :: WidgetClass self => Signal self (Allocation -> IO ())

Inform widget about the size it has.

  • After querying a widget for the size it wants to have (through emitting the "sizeRequest" signal) a container will emit this signal to inform the widget about the real size it should occupy.
showSignal :: WidgetClass self => Signal self (IO ())
The widget is shown.
hideSignal :: WidgetClass self => Signal self (IO ())
The widget is hidden.
focus :: WidgetClass self => Signal self (DirectionType -> IO Bool)
The widget gains focus via the given user action.
stateChanged :: WidgetClass self => Signal self (StateType -> IO ())
The state of the widget (input focus, insensitive, etc.) has changed.
parentSet :: WidgetClass self => Signal self (Widget -> IO ())
The parent-set signal is emitted when a new parent has been set on a widget. The parameter is the new parent.
hierarchyChanged :: WidgetClass self => Signal self (Widget -> IO ())
Emitted when there is a change in the hierarchy to which a widget belong. More precisely, a widget is anchored when its toplevel ancestor is a Window. This signal is emitted when a widget changes from un-anchored to anchored or vice-versa.
styleSet :: WidgetClass self => Signal self (Style -> IO ())
The style-set signal is emitted when a new style has been set on a widget. Note that style-modifying functions like widgetModifyBase also cause this signal to be emitted.
directionChanged :: WidgetClass self => Signal self (TextDirection -> IO ())
The default direction of text writing has changed.
grabNotify :: WidgetClass self => Signal self (Bool -> IO ())

The grabNotify signal is emitted when a widget becomes shadowed by a Gtk+ grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed.

A widget is shadowed by a grabAdd when the topmost grab widget in the grab stack of its window group is not its ancestor.

popupMenuSignal :: WidgetClass self => Signal self (IO Bool)
This signal gets emitted whenever a widget should pop up a context-sensitive menu. This usually happens through the standard key binding mechanism; by pressing a certain key while a widget is focused, the user can cause the widget to pop up a menu. For example, the Entry widget creates a menu with clipboard commands.
showHelp :: WidgetClass self => Signal self (WidgetHelpType -> IO Bool)
Tell the widget to show an explanatory help text. Should return True if help has been shown.
accelClosuresChanged :: WidgetClass self => Signal self (IO ())
The set of keyboard accelerators has changed.
screenChanged :: WidgetClass self => Signal self (Screen -> IO ())
The widget moved to a new screen.
Events
buttonPressEvent :: WidgetClass self => Signal self (EventM EButton Bool)
A mouse button has been depressed while the mouse pointer was within the widget area. Sets the widget's ButtonPressMask flag.
buttonReleaseEvent :: WidgetClass self => Signal self (EventM EButton Bool)
A mouse button has been released. Sets the widget's ButtonReleaseMask flag.
configureEvent :: WidgetClass self => Signal self (EventM EConfigure Bool)
The size of the window has changed.
deleteEvent :: WidgetClass self => Signal self (EventM EAny Bool)
The deleteEvent signal is emitted if a user requests that a toplevel window is closed. The default handler for this signal destroys the window. Calling widgetHide and returning True on reception of this signal will cause the window to be hidden instead, so that it can later be shown again without reconstructing it.
destroyEvent :: WidgetClass self => Signal self (EventM EAny Bool)
The destroyEvent signal is emitted when a DrawWindow is destroyed. You rarely get this signal, because most widgets disconnect themselves from their window before they destroy it, so no widget owns the window at destroy time.
enterNotifyEvent :: WidgetClass self => Signal self (EventM ECrossing Bool)
The mouse pointer has entered the widget. Sets the widget's EnterNotifyMask flag.
exposeEvent :: WidgetClass self => Signal self (EventM EExpose Bool)

Instructs the widget to redraw.

  • This event is useful for the DrawingArea. On receiving this signal the content of the passed Rectangle or Region needs to be redrawn. If a client will redraw the whole area and is not interested in the extra information in Expose, it is more efficient to use exposeEventRect.
  • Widgets that are very expensive to re-render, such as an image editor, may prefer to use the exposeEvent which delivers a Region in addition to a Rectangle. A Region consists of several rectangles that need redrawing.
focusInEvent :: WidgetClass self => Signal self (EventM EFocus Bool)
The widget gets the input focus. Sets the widget's FocusChangeMask flag.
focusOutEvent :: WidgetClass self => Signal self (EventM EFocus Bool)
The widget lost the input focus. Sets the widget's FocusChangeMask flag.
grabBrokenEvent :: WidgetClass self => Signal self (EventM EGrabBroken Bool)

Emitted when a pointer or keyboard grab on a window belonging to widget gets broken.

On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again.

  • Available since Gtk+ version 2.8
keyPressEvent :: WidgetClass self => Signal self (EventM EKey Bool)
A key has been depressed. Sets the widget's KeyPressMask flag.
keyReleaseEvent :: WidgetClass self => Signal self (EventM EKey Bool)
A key has been released. Sets the widget's KeyReleaseMask flag.
leaveNotifyEvent :: WidgetClass self => Signal self (EventM ECrossing Bool)
The mouse pointer has left the widget. Sets the widget's LeaveNotifyMask flag.
mapEvent :: WidgetClass self => Signal self (EventM EAny Bool)
The window is put onto the screen.
motionNotifyEvent :: WidgetClass self => Signal self (EventM EMotion Bool)

The mouse pointer has moved. Since receiving all mouse movements is expensive, it is necessary to specify exactly what mouse motions are required by calling widgetAddEvents on this widget with one or more of the following flags:

If the application cannot respond quickly enough to all mouse motions, it is possible to only receive motion signals on request. In this case, you need to add PointerMotionHintMask to the flags above and call drawWindowGetPointer each time a motion even is received. Motion events will then be delayed until the function is called.

noExposeEvent :: WidgetClass self => Signal self (EventM EAny Bool)
Generated when the area of a Drawable being copied using, e.g. drawDrawable, is completely available.
proximityInEvent :: WidgetClass self => Signal self (EventM EProximity Bool)
The pen of a graphics tablet was put down. Sets the widget's ProximityInMask flag.
proximityOutEvent :: WidgetClass self => Signal self (EventM EProximity Bool)
The pen of a graphics tablet was lifted off the tablet. Sets the widget's ProximityOutMask flag.
scrollEvent :: WidgetClass self => Signal self (EventM EScroll Bool)
The scroll wheel of the mouse has been used. Sets the widget's ScrollMask flag.
unmapEvent :: WidgetClass self => Signal self (EventM EAny Bool)
The window is taken off the screen.
visibilityNotifyEvent :: WidgetClass self => Signal self (EventM EVisibility Bool)
Emitted when the window visibility status has changed. Sets the widget's VisibilityNotifyMask flag.
windowStateEvent :: WidgetClass self => Signal self (EventM EWindowState Bool)
Emitted when the state of the window changes, i.e. when it is minimized, moved to the top, etc.
Deprecated
onButtonPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)

A Button was pressed.

  • This widget is part of a button which was just pressed. The event passed to the user function is a Button event.
afterButtonPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onButtonRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
A Button was released.
afterButtonRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onClient :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterClient :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onConfigure :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
The widget's status has changed.
afterConfigure :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onDelete :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
This signal is emitted when the close icon on the surrounding window is pressed. The default action is to emit the "destroy" signal.
afterDelete :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onDestroyEvent :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)

The widget will be destroyed.

  • The widget received a destroy event from the window manager.
afterDestroyEvent :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onDirectionChanged :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
The default text direction was changed.
afterDirectionChanged :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onEnterNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)

Mouse cursor entered widget.

afterEnterNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onLeaveNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)

Mouse cursor leaves widget.

afterLeaveNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onExpose :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)

Instructs the widget to redraw.

  • This event is useful for the DrawingArea. On receiving this signal the content of the passed Rectangle or Region needs to be redrawn. The return value should be True if the region was completely redrawn and False if other handlers in the chain should be invoked. If a client will redraw the whole area and is not interested in the extra information in Expose, it is more efficient to use onExposeRect.
  • Widgets that are very expensive to re-render, such as an image editor, may prefer to use the onExpose call back which delivers a Region in addition to a Rectangle. A Region consists of several rectangles that need redrawing. The simpler onExposeRect event encodes the area to be redrawn as a bounding rectangle which might be easier to deal with in a particular application.
afterExpose :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onExposeRect :: WidgetClass w => w -> (Rectangle -> IO ()) -> IO (ConnectId w)
Expose event delivering a Rectangle.
afterExposeRect :: WidgetClass w => w -> (Rectangle -> IO ()) -> IO (ConnectId w)
onFocus :: WidgetClass w => w -> (DirectionType -> IO Bool) -> IO (ConnectId w)
This signal is called if the widget receives the input focus.
afterFocus :: WidgetClass w => w -> (DirectionType -> IO Bool) -> IO (ConnectId w)
onFocusIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
Widget gains input focus.
afterFocusIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onFocusOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
Widget looses input focus.
afterFocusOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onGrabFocus :: WidgetClass w => w -> IO () -> IO (ConnectId w)

The widget is about to receive all events.

  • It is possible to redirect all input events to one widget to force the user to use only this widget. Such a situation is initiated by addGrab.
afterGrabFocus :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onDestroy :: WidgetClass w => w -> IO () -> IO (ConnectId w)

The widget will be destroyed.

  • This is the last signal this widget will receive.
afterDestroy :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onHide :: WidgetClass w => w -> IO () -> IO (ConnectId w)

The widget was asked to hide itself.

  • This signal is emitted each time widgetHide is called. Use onUnmap when your application needs to be informed when the widget is actually removed from screen.
afterHide :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onHierarchyChanged :: WidgetClass w => w -> IO () -> IO (ConnectId w)

The toplevel window changed.

  • When a subtree of widgets is removed or added from a tree with a toplevel window this signal is emitted. It is emitted on each widget in the detached or attached subtree.
afterHierarchyChanged :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onKeyPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
A key was pressed.
afterKeyPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onKeyRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
A key was released.
afterKeyRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onMnemonicActivate :: WidgetClass w => w -> (Bool -> IO Bool) -> IO (ConnectId w)
afterMnemonicActivate :: WidgetClass w => w -> (Bool -> IO Bool) -> IO (ConnectId w)
onMotionNotify :: WidgetClass w => w -> Bool -> (Event -> IO Bool) -> IO (ConnectId w)

Track mouse movements.

  • If hint is False, a callback for every movement of the mouse is generated. To avoid a backlog of mouse messages, it is usually sufficient to sent hint to True, generating only one event. The application now has to state that it is ready for the next message by calling drawWindowGetPointer.
afterMotionNotify :: WidgetClass w => w -> Bool -> (Event -> IO Bool) -> IO (ConnectId w)
onParentSet :: (WidgetClass w, WidgetClass old) => w -> (old -> IO ()) -> IO (ConnectId w)
afterParentSet :: (WidgetClass w, WidgetClass old) => w -> (old -> IO ()) -> IO (ConnectId w)
onPopupMenu :: WidgetClass w => w -> IO () -> IO (ConnectId w)
afterPopupMenu :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onProximityIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)

The input device became active.

  • This event indicates that a pen of a graphics tablet or similar device is now touching the tablet.
afterProximityIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onProximityOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)

The input device became inactive.

  • The pen was removed from the graphics tablet's surface.
afterProximityOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onRealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)
This widget's drawing area is about to be destroyed.
afterRealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onScroll :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)

The mouse wheel has turned.

afterScroll :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onShow :: WidgetClass w => w -> IO () -> IO (ConnectId w)

The widget was asked to show itself.

  • This signal is emitted each time widgetShow is called. Use onMap when your application needs to be informed when the widget is actually shown.
afterShow :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onSizeAllocate :: WidgetClass w => w -> (Allocation -> IO ()) -> IO (ConnectId w)

Inform widget about the size it has.

  • After querying a widget for the size it wants to have (through emitting the "sizeRequest" signal) a container will emit this signal to inform the widget about the real size it should occupy.
afterSizeAllocate :: WidgetClass w => w -> (Allocation -> IO ()) -> IO (ConnectId w)
onSizeRequest :: WidgetClass w => w -> IO Requisition -> IO (ConnectId w)

Query the widget for the size it likes to have.

  • A parent container emits this signal to its child to query the needed height and width of the child. There is not guarantee that the widget will actually get this area.
afterSizeRequest :: WidgetClass w => w -> IO Requisition -> IO (ConnectId w)
onStateChanged :: WidgetClass w => w -> (StateType -> IO ()) -> IO (ConnectId w)
afterStateChanged :: WidgetClass w => w -> (StateType -> IO ()) -> IO (ConnectId w)
onUnmap :: WidgetClass w => w -> IO () -> IO (ConnectId w)
The widget was removed from screen.
afterUnmap :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onUnrealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)
This widget's drawing area is about to be destroyed.
afterUnrealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)
onVisibilityNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterVisibilityNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
onWindowState :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
afterWindowState :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)
Produced by Haddock version 0.8