gi-gtk-4.0.5: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.TreeExpander

Description

GtkTreeExpander is a widget that provides an expander for a list.

It is typically placed as a bottommost child into a GtkListView to allow users to expand and collapse children in a list with a TreeListModel. GtkTreeExpander provides the common UI elements, gestures and keybindings for this purpose.

On top of this, the "listitem.expand", "listitem.collapse" and "listitem.toggle-expand" actions are provided to allow adding custom UI for managing expanded state.

The GtkTreeListModel must be set to not be passthrough. Then it will provide TreeListRow items which can be set via treeExpanderSetListRow on the expander. The expander will then watch that row item automatically. treeExpanderSetChild sets the widget that displays the actual row contents.

CSS nodes

treeexpander
├── [indent]*
├── [expander]
╰── <child>

GtkTreeExpander has zero or one CSS nodes with the name "expander" that should display the expander icon. The node will be :checked when it is expanded. If the node is not expandable, an "indent" node will be displayed instead.

For every level of depth, another "indent" node is prepended.

Accessibility

GtkTreeExpander uses the AccessibleRoleGroup role. The expander icon is represented as a AccessibleRoleButton, labelled by the expander's child, and toggling it will change the AccessibleStateExpanded state.

Synopsis

Exported types

class (GObject o, IsDescendantOf TreeExpander o) => IsTreeExpander o Source #

Type class for types which can be safely cast to TreeExpander, for instance with toTreeExpander.

Instances

Instances details
(GObject o, IsDescendantOf TreeExpander o) => IsTreeExpander o Source # 
Instance details

Defined in GI.Gtk.Objects.TreeExpander

toTreeExpander :: (MonadIO m, IsTreeExpander o) => o -> m TreeExpander Source #

Cast to TreeExpander, 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, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, 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, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getItem, getLastChild, getLayoutManager, getListRow, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setListRow, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

getChild

treeExpanderGetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeExpander a) 
=> a

self: a GtkTreeExpander

-> m (Maybe Widget)

Returns: The child displayed by self

Gets the child widget displayed by self.

getItem

treeExpanderGetItem Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeExpander a) 
=> a

self: a GtkTreeExpander

-> m (Maybe Object)

Returns: The item of the row

Forwards the item set on the GtkTreeListRow that self is managing.

This call is essentially equivalent to calling:

c code

gtk_tree_list_row_get_item (gtk_tree_expander_get_list_row (@self));

getListRow

treeExpanderGetListRow Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeExpander a) 
=> a

self: a GtkTreeExpander

-> m (Maybe TreeListRow)

Returns: The list row displayed by self

Gets the list row managed by self.

new

treeExpanderNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m TreeExpander

Returns: a new GtkTreeExpander

Creates a new GtkTreeExpander

setChild

treeExpanderSetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeExpander a, IsWidget b) 
=> a

self: a GtkTreeExpander

-> Maybe b

child: a GtkWidget

-> m () 

Sets the content widget to display.

setListRow

treeExpanderSetListRow Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeExpander a, IsTreeListRow b) 
=> a

self: a GtkTreeExpander widget

-> Maybe b

listRow: a GtkTreeListRow

-> m () 

Sets the tree list row that this expander should manage.

Properties

child

The child widget with the actual contents.

clearTreeExpanderChild :: (MonadIO m, IsTreeExpander o) => o -> m () Source #

Set the value of the “child” property to Nothing. When overloading is enabled, this is equivalent to

clear #child

constructTreeExpanderChild :: (IsTreeExpander o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “child” property. This is rarely needed directly, but it is used by new.

getTreeExpanderChild :: (MonadIO m, IsTreeExpander o) => o -> m (Maybe Widget) Source #

Get the value of the “child” property. When overloading is enabled, this is equivalent to

get treeExpander #child

setTreeExpanderChild :: (MonadIO m, IsTreeExpander o, IsWidget a) => o -> a -> m () Source #

Set the value of the “child” property. When overloading is enabled, this is equivalent to

set treeExpander [ #child := value ]

item

The item held by this expander's row.

getTreeExpanderItem :: (MonadIO m, IsTreeExpander o) => o -> m (Maybe Object) Source #

Get the value of the “item” property. When overloading is enabled, this is equivalent to

get treeExpander #item

listRow

The list row to track for expander state.

clearTreeExpanderListRow :: (MonadIO m, IsTreeExpander o) => o -> m () Source #

Set the value of the “list-row” property to Nothing. When overloading is enabled, this is equivalent to

clear #listRow

constructTreeExpanderListRow :: (IsTreeExpander o, MonadIO m, IsTreeListRow a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “list-row” property. This is rarely needed directly, but it is used by new.

getTreeExpanderListRow :: (MonadIO m, IsTreeExpander o) => o -> m (Maybe TreeListRow) Source #

Get the value of the “list-row” property. When overloading is enabled, this is equivalent to

get treeExpander #listRow

setTreeExpanderListRow :: (MonadIO m, IsTreeExpander o, IsTreeListRow a) => o -> a -> m () Source #

Set the value of the “list-row” property. When overloading is enabled, this is equivalent to

set treeExpander [ #listRow := value ]