Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GtkRoot
is the interface implemented by all widgets that can act as a toplevel
widget.
The root widget takes care of providing the connection to the windowing system and manages layout, drawing and event delivery for its widget hierarchy.
The obvious example of a GtkRoot
is GtkWindow
.
To get the display to which a GtkRoot
belongs, use
rootGetDisplay
.
GtkRoot
also maintains the location of keyboard focus inside its widget
hierarchy, with rootSetFocus
and rootGetFocus
.
Synopsis
- newtype Root = Root (ManagedPtr Root)
- class (GObject o, IsDescendantOf Root o) => IsRoot o
- toRoot :: (MonadIO m, IsRoot o) => o -> m Root
- rootGetDisplay :: (HasCallStack, MonadIO m, IsRoot a) => a -> m Display
- rootGetFocus :: (HasCallStack, MonadIO m, IsRoot a) => a -> m (Maybe Widget)
- rootSetFocus :: (HasCallStack, MonadIO m, IsRoot a, IsWidget b) => a -> Maybe b -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Root Source # | |
GObject Root Source # | |
Defined in GI.Gtk.Interfaces.Root | |
ManagedPtrNewtype Root Source # | |
Defined in GI.Gtk.Interfaces.Root toManagedPtr :: Root -> ManagedPtr Root | |
TypedObject Root Source # | |
Defined in GI.Gtk.Interfaces.Root | |
HasParentTypes Root Source # | |
Defined in GI.Gtk.Interfaces.Root | |
IsGValue (Maybe Root) Source # | Convert |
Defined in GI.Gtk.Interfaces.Root gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Root -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Root) | |
type ParentTypes Root Source # | |
Defined in GI.Gtk.Interfaces.Root |
class (GObject o, IsDescendantOf Root o) => IsRoot o Source #
Instances
(GObject o, IsDescendantOf Root o) => IsRoot o Source # | |
Defined in GI.Gtk.Interfaces.Root |
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocus, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRenderer, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSurface, getSurfaceTransform, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocus, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.
getDisplay
:: (HasCallStack, MonadIO m, IsRoot a) | |
=> a |
|
-> m Display | Returns: the display of |
Returns the display that this GtkRoot
is on.
getFocus
:: (HasCallStack, MonadIO m, IsRoot a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the currently focused widget |
Retrieves the current focused widget within the root.
Note that this is the widget that would have the focus
if the root is active; if the root is not focused then
gtk_widget_has_focus (widget)
will be False
for the
widget.
setFocus
:: (HasCallStack, MonadIO m, IsRoot a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> m () |
If focus
is not the current focus widget, and is focusable, sets
it as the focus widget for the root.
If focus
is Nothing
, unsets the focus widget for the root.
To set the focus to a particular widget in the root, it is usually
more convenient to use widgetGrabFocus
instead of
this function.