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.TreeListModel

Description

TreeListModel is a ListModel implementation that can expand rows by creating new child list models on demand.

Synopsis

Exported types

newtype TreeListModel Source #

Memory-managed wrapper type.

Constructors

TreeListModel (ManagedPtr TreeListModel) 

Instances

Instances details
Eq TreeListModel Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListModel

GObject TreeListModel Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListModel

ManagedPtrNewtype TreeListModel Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListModel

Methods

toManagedPtr :: TreeListModel -> ManagedPtr TreeListModel

TypedObject TreeListModel Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListModel

Methods

glibType :: IO GType

HasParentTypes TreeListModel Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListModel

IsGValue (Maybe TreeListModel) Source #

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

Instance details

Defined in GI.Gtk.Objects.TreeListModel

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes TreeListModel Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListModel

type ParentTypes TreeListModel = '[Object, ListModel]

class (GObject o, IsDescendantOf TreeListModel o) => IsTreeListModel o Source #

Type class for types which can be safely cast to TreeListModel, for instance with toTreeListModel.

Instances

Instances details
(GObject o, IsDescendantOf TreeListModel o) => IsTreeListModel o Source # 
Instance details

Defined in GI.Gtk.Objects.TreeListModel

toTreeListModel :: (MonadIO m, IsTreeListModel o) => o -> m TreeListModel Source #

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

Methods

getAutoexpand

treeListModelGetAutoexpand Source #

Arguments

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

self: a TreeListModel

-> m Bool

Returns: True if the model is set to autoexpand

Gets whether the model is set to automatically expand new rows that get added. This can be either rows added by changes to the underlying models or via treeListRowSetExpanded.

getChildRow

treeListModelGetChildRow Source #

Arguments

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

self: a TreeListModel

-> Word32

position: position of the child to get

-> m (Maybe TreeListRow)

Returns: the child in position

Gets the row item corresponding to the child at index position for self's root model.

If position is greater than the number of children in the root model, Nothing is returned.

Do not confuse this function with treeListModelGetRow.

getModel

treeListModelGetModel Source #

Arguments

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

self: a TreeListModel

-> m ListModel

Returns: the root model

Gets the root model that self was created with.

getPassthrough

treeListModelGetPassthrough Source #

Arguments

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

self: a TreeListModel

-> m Bool

Returns: True if the model is passing through original row items

If this function returns False, the ListModel functions for self return custom TreeListRow objects. You need to call treeListRowGetItem on these objects to get the original item.

If True, the values of the child models are passed through in their original state. You then need to call treeListModelGetRow to get the custom GtkTreeListRows.

getRow

treeListModelGetRow Source #

Arguments

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

self: a TreeListModel

-> Word32

position: the position of the row to fetch

-> m (Maybe TreeListRow)

Returns: The row item

Gets the row object for the given row. If position is greater than the number of items in self, Nothing is returned.

The row object can be used to expand and collapse rows as well as to inspect its position in the tree. See its documentation for details.

This row object is persistent and will refer to the current item as long as the row is present in self, independent of other rows being added or removed.

If self is set to not be passthrough, this function is equivalent to calling g_list_model_get_item().

Do not confuse this function with treeListModelGetChildRow.

new

treeListModelNew Source #

Arguments

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

root: The ListModel to use as root

-> Bool

passthrough: True to pass through items from the models

-> Bool

autoexpand: True to set the autoexpand property and expand the root model

-> TreeListModelCreateModelFunc

createFunc: Function to call to create the ListModel for the children of an item

-> m TreeListModel

Returns: a newly created TreeListModel.

Creates a new empty TreeListModel displaying root with all rows collapsed.

setAutoexpand

treeListModelSetAutoexpand Source #

Arguments

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

self: a TreeListModel

-> Bool

autoexpand: True to make the model autoexpand its rows

-> m () 

If set to True, the model will recursively expand all rows that get added to the model. This can be either rows added by changes to the underlying models or via treeListRowSetExpanded.

Properties

autoexpand

If all rows should be expanded by default

constructTreeListModelAutoexpand :: (IsTreeListModel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getTreeListModelAutoexpand :: (MonadIO m, IsTreeListModel o) => o -> m Bool Source #

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

get treeListModel #autoexpand

setTreeListModelAutoexpand :: (MonadIO m, IsTreeListModel o) => o -> Bool -> m () Source #

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

set treeListModel [ #autoexpand := value ]

model

The root model displayed

getTreeListModelModel :: (MonadIO m, IsTreeListModel o) => o -> m ListModel Source #

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

get treeListModel #model

passthrough

If False, the ListModel functions for this object return custom TreeListRow objects. If True, the values of the child models are pass through unmodified.

constructTreeListModelPassthrough :: (IsTreeListModel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getTreeListModelPassthrough :: (MonadIO m, IsTreeListModel o) => o -> m Bool Source #

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

get treeListModel #passthrough