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

GI.Gtk.Objects.TreeListRow

Description

TreeListRow is the object used by TreeListModel to represent items. It allows navigating the model as a tree and modify the state of rows.

TreeListRow instances are created by a TreeListModel only when the TreeListModel:passthrough property is not set.

There are various support objects that can make use of TreeListRow objects, such as the TreeExpander widget that allows displaying an icon to expand or collapse a row or TreeListRowSorter that makes it possible to sort trees properly.

Synopsis

Exported types

newtype TreeListRow Source #

Memory-managed wrapper type.

Constructors

TreeListRow (ManagedPtr TreeListRow) 

Instances

Instances details
Eq TreeListRow Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListRow

GObject TreeListRow Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListRow

ManagedPtrNewtype TreeListRow Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListRow

Methods

toManagedPtr :: TreeListRow -> ManagedPtr TreeListRow

TypedObject TreeListRow Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListRow

Methods

glibType :: IO GType

HasParentTypes TreeListRow Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListRow

IsGValue (Maybe TreeListRow) Source #

Convert TreeListRow to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.TreeListRow

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe TreeListRow -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe TreeListRow)

type ParentTypes TreeListRow Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListRow

type ParentTypes TreeListRow = '[Object]

class (GObject o, IsDescendantOf TreeListRow o) => IsTreeListRow o Source #

Type class for types which can be safely cast to TreeListRow, for instance with toTreeListRow.

Instances

Instances details
(GObject o, IsDescendantOf TreeListRow o) => IsTreeListRow o Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListRow

toTreeListRow :: (MonadIO m, IsTreeListRow o) => o -> m TreeListRow Source #

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

Methods

getChildRow

treeListRowGetChildRow Source #

Arguments

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

self: a TreeListRow

-> Word32

position: position of the child to get

-> m (Maybe TreeListRow)

Returns: the child in position

If self is not expanded or position is greater than the number of children, Nothing is returned.

getChildren

treeListRowGetChildren Source #

Arguments

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

self: a TreeListRow

-> m (Maybe ListModel)

Returns: The model containing the children

If the row is expanded, gets the model holding the children of self.

This model is the model created by the TreeListModelCreateModelFunc and contains the original items, no matter what value TreeListModel:passthrough is set to.

getDepth

treeListRowGetDepth Source #

Arguments

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

self: a TreeListRow

-> m Word32

Returns: The depth of this row

Gets the depth of this row. Rows that correspond to items in the root model have a depth of zero, rows corresponding to items of models of direct children of the root model have a depth of 1 and so on.

The depth of a row never changes until the row is destroyed.

getExpanded

treeListRowGetExpanded Source #

Arguments

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

self: a TreeListRow

-> m Bool

Returns: True if the row is expanded

Gets if a row is currently expanded.

getItem

treeListRowGetItem Source #

Arguments

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

self: a TreeListRow

-> m (Maybe Object)

Returns: The item of this row or Nothing when the row was destroyed

Gets the item corresponding to this row,

The value returned by this function never changes until the row is destroyed.

getParent

treeListRowGetParent Source #

Arguments

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

self: a TreeListRow

-> m (Maybe TreeListRow)

Returns: The parent of self

Gets the row representing the parent for self. That is the row that would need to be collapsed to make this row disappear.

If self is a row corresponding to the root model, Nothing is returned.

The value returned by this function never changes until the row is destroyed.

getPosition

treeListRowGetPosition Source #

Arguments

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

self: a TreeListRow

-> m Word32

Returns: The position in the model

Returns the position in the TreeListModel that self occupies at the moment.

isExpandable

treeListRowIsExpandable Source #

Arguments

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

self: a TreeListRow

-> m Bool

Returns: True if the row is expandable

Checks if a row can be expanded. This does not mean that the row is actually expanded, this can be checked with treeListRowGetExpanded

If a row is expandable never changes until the row is destroyed.

setExpanded

treeListRowSetExpanded Source #

Arguments

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

self: a TreeListRow

-> Bool

expanded: True if the row should be expanded

-> m () 

Expands or collapses a row.

If a row is expanded, the model of calling the TreeListModelCreateModelFunc for the row's item will be inserted after this row. If a row is collapsed, those items will be removed from the model.

If the row is not expandable, this function does nothing.

Properties

children

The model holding the row's children.

getTreeListRowChildren :: (MonadIO m, IsTreeListRow o) => o -> m (Maybe ListModel) Source #

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

get treeListRow #children

depth

The depth in the tree of this row

getTreeListRowDepth :: (MonadIO m, IsTreeListRow o) => o -> m Word32 Source #

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

get treeListRow #depth

expandable

If this row can ever be expanded

getTreeListRowExpandable :: (MonadIO m, IsTreeListRow o) => o -> m Bool Source #

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

get treeListRow #expandable

expanded

If this row is currently expanded

constructTreeListRowExpanded :: (IsTreeListRow o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getTreeListRowExpanded :: (MonadIO m, IsTreeListRow o) => o -> m Bool Source #

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

get treeListRow #expanded

setTreeListRowExpanded :: (MonadIO m, IsTreeListRow o) => o -> Bool -> m () Source #

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

set treeListRow [ #expanded := value ]

item

The item held in this row

getTreeListRowItem :: (MonadIO m, IsTreeListRow o) => o -> m (Maybe Object) Source #

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

get treeListRow #item