Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GtkTreeExpander is a widget that provides an expander for a list.
It is typically placed as a bottommost child into a ListView
to allow
users to expand and collapse children in a list with a TreeListModel
.
It will provide 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 TreeListModel
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
plain code
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
- newtype TreeExpander = TreeExpander (ManagedPtr TreeExpander)
- class (GObject o, IsDescendantOf TreeExpander o) => IsTreeExpander o
- toTreeExpander :: (MonadIO m, IsTreeExpander o) => o -> m TreeExpander
- treeExpanderGetChild :: (HasCallStack, MonadIO m, IsTreeExpander a) => a -> m (Maybe Widget)
- treeExpanderGetItem :: (HasCallStack, MonadIO m, IsTreeExpander a) => a -> m (Maybe Object)
- treeExpanderGetListRow :: (HasCallStack, MonadIO m, IsTreeExpander a) => a -> m (Maybe TreeListRow)
- treeExpanderNew :: (HasCallStack, MonadIO m) => m TreeExpander
- treeExpanderSetChild :: (HasCallStack, MonadIO m, IsTreeExpander a, IsWidget b) => a -> Maybe b -> m ()
- treeExpanderSetListRow :: (HasCallStack, MonadIO m, IsTreeExpander a, IsTreeListRow b) => a -> Maybe b -> m ()
- clearTreeExpanderChild :: (MonadIO m, IsTreeExpander o) => o -> m ()
- constructTreeExpanderChild :: (IsTreeExpander o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getTreeExpanderChild :: (MonadIO m, IsTreeExpander o) => o -> m (Maybe Widget)
- setTreeExpanderChild :: (MonadIO m, IsTreeExpander o, IsWidget a) => o -> a -> m ()
- getTreeExpanderItem :: (MonadIO m, IsTreeExpander o) => o -> m (Maybe Object)
- clearTreeExpanderListRow :: (MonadIO m, IsTreeExpander o) => o -> m ()
- constructTreeExpanderListRow :: (IsTreeExpander o, MonadIO m, IsTreeListRow a) => a -> m (GValueConstruct o)
- getTreeExpanderListRow :: (MonadIO m, IsTreeExpander o) => o -> m (Maybe TreeListRow)
- setTreeExpanderListRow :: (MonadIO m, IsTreeExpander o, IsTreeListRow a) => o -> a -> m ()
Exported types
newtype TreeExpander Source #
Memory-managed wrapper type.
TreeExpander (ManagedPtr TreeExpander) |
Instances
Eq TreeExpander Source # | |
Defined in GI.Gtk.Objects.TreeExpander (==) :: TreeExpander -> TreeExpander -> Bool # (/=) :: TreeExpander -> TreeExpander -> Bool # | |
GObject TreeExpander Source # | |
Defined in GI.Gtk.Objects.TreeExpander | |
ManagedPtrNewtype TreeExpander Source # | |
Defined in GI.Gtk.Objects.TreeExpander toManagedPtr :: TreeExpander -> ManagedPtr TreeExpander | |
TypedObject TreeExpander Source # | |
Defined in GI.Gtk.Objects.TreeExpander | |
HasParentTypes TreeExpander Source # | |
Defined in GI.Gtk.Objects.TreeExpander | |
IsGValue (Maybe TreeExpander) Source # | Convert |
Defined in GI.Gtk.Objects.TreeExpander gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TreeExpander -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TreeExpander) | |
type ParentTypes TreeExpander Source # | |
Defined in GI.Gtk.Objects.TreeExpander |
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
(GObject o, IsDescendantOf TreeExpander o) => IsTreeExpander o Source # | |
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
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
:: (HasCallStack, MonadIO m, IsTreeExpander a) | |
=> a |
|
-> m (Maybe Widget) | Returns: The child displayed by |
Gets the child widget displayed by self
.
getItem
:: (HasCallStack, MonadIO m, IsTreeExpander a) | |
=> a |
|
-> m (Maybe Object) | Returns: The item of the row |
Forwards the item set on the TreeListRow
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 #
:: (HasCallStack, MonadIO m, IsTreeExpander a) | |
=> a |
|
-> m (Maybe TreeListRow) | Returns: The list row displayed by |
Gets the list row managed by self
.
new
:: (HasCallStack, MonadIO m) | |
=> m TreeExpander | Returns: a new |
Creates a new TreeExpander
setChild
:: (HasCallStack, MonadIO m, IsTreeExpander a, IsWidget b) | |
=> a |
|
-> Maybe b | |
-> m () |
Sets the content widget to display.
setListRow
treeExpanderSetListRow Source #
:: (HasCallStack, MonadIO m, IsTreeExpander a, IsTreeListRow b) | |
=> a |
|
-> Maybe b |
|
-> 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 ]