gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Interfaces.Root

Contents

- Exported types
- Methods
  - getDisplay
  - getFocus
  - setFocus

Description

An interface for widgets that can act as the root of a widget hierarchy.

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

newtype Root Source #

Memory-managed wrapper type.

Constructors

Root (ManagedPtr Root) |

#### Instances

Instances details

Eq Root Source # |
Instance details Defined in GI.Gtk.Interfaces.Root Methods (==) :: Root -> Root -> Bool Source # (/=) :: Root -> Root -> Bool Source #
GObject Root Source # |
Instance details Defined in GI.Gtk.Interfaces.Root
ManagedPtrNewtype Root Source # |
Instance details Defined in GI.Gtk.Interfaces.Root Methods toManagedPtr :: Root -> ManagedPtr Root Source #
TypedObject Root Source # |
Instance details Defined in GI.Gtk.Interfaces.Root Methods glibType :: IO GType Source #
HasParentTypes Root Source # |
Instance details Defined in GI.Gtk.Interfaces.Root
IsGValue (Maybe Root) Source # | Convert `Root` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Interfaces.Root Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Root -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Root) Source #
type ParentTypes Root Source # |
Instance details Defined in GI.Gtk.Interfaces.Root type ParentTypes Root = '[Native, Widget, Object]

class (GObject o, IsDescendantOf Root o) => IsRoot o Source #

Type class for types which can be safely cast to `Root`, for instance with `toRoot`.

#### Instances

Instances details

(GObject o, IsDescendantOf Root o) => IsRoot o Source # |
Instance details Defined in GI.Gtk.Interfaces.Root

toRoot :: (MonadIO m, IsRoot o) => o -> m Root Source #

Cast to `Root`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### 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, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, 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, getLimitEvents, 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, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

## getDisplay

rootGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsRoot a) |
=> a | `self`: a `GtkRoot`
-> m Display | Returns: the display of `root`

Returns the display that this `GtkRoot` is on.

## getFocus

rootGetFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsRoot a) |
=> a | `self`: a `GtkRoot`
-> 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

rootSetFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsRoot a, IsWidget b) |
=> a | `self`: a `GtkRoot`
-> Maybe b | `focus`: widget to be the new focus widget, or `Nothing` to unset the focus widget
-> 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.