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.Objects.TreeListRow

Contents

- Exported types
- Methods
  - getChildRow
  - getChildren
  - getDepth
  - getExpanded
  - getItem
  - getParent
  - getPosition
  - isExpandable
  - setExpanded
- Properties
  - children
  - depth
  - expandable
  - expanded
  - item

Description

The type of item used by `GtkTreeListModel`.

It allows navigating the model as a tree and modify the state of rows.

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

There are various support objects that can make use of `GtkTreeListRow` 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

- newtype TreeListRow = TreeListRow (ManagedPtr TreeListRow)
- class (GObject o, IsDescendantOf TreeListRow o) => IsTreeListRow o
- toTreeListRow :: (MonadIO m, IsTreeListRow o) => o -> m TreeListRow
- treeListRowGetChildRow :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> Word32 -> m (Maybe TreeListRow)
- treeListRowGetChildren :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> m (Maybe ListModel)
- treeListRowGetDepth :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> m Word32
- treeListRowGetExpanded :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> m Bool
- treeListRowGetItem :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> m (Maybe Object)
- treeListRowGetParent :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> m (Maybe TreeListRow)
- treeListRowGetPosition :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> m Word32
- treeListRowIsExpandable :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> m Bool
- treeListRowSetExpanded :: (HasCallStack, MonadIO m, IsTreeListRow a) => a -> Bool -> m ()
- getTreeListRowChildren :: (MonadIO m, IsTreeListRow o) => o -> m (Maybe ListModel)
- getTreeListRowDepth :: (MonadIO m, IsTreeListRow o) => o -> m Word32
- getTreeListRowExpandable :: (MonadIO m, IsTreeListRow o) => o -> m Bool
- constructTreeListRowExpanded :: (IsTreeListRow o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTreeListRowExpanded :: (MonadIO m, IsTreeListRow o) => o -> m Bool
- setTreeListRowExpanded :: (MonadIO m, IsTreeListRow o) => o -> Bool -> m ()
- getTreeListRowItem :: (MonadIO m, IsTreeListRow o) => o -> m (Maybe Object)

# 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 Methods (==) :: TreeListRow -> TreeListRow -> Bool Source # (/=) :: TreeListRow -> TreeListRow -> Bool Source #
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 Source #
TypedObject TreeListRow Source # |
Instance details Defined in GI.Gtk.Objects.TreeListRow Methods glibType :: IO GType Source #
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 Source # gvalueSet_ :: Ptr GValue -> Maybe TreeListRow -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe TreeListRow) Source #
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

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

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isExpandable, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getChildRow, getChildren, getData, getDepth, getExpanded, getItem, getParent, getPosition, getProperty, getQdata.

#### Setters

setData, setDataFull, setExpanded, setProperty.

## getChildRow

treeListRowGetChildRow Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeListRow a) |
=> a | `self`: a `GtkTreeListRow`
-> 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 `GtkTreeListRow`
-> 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 [callback`gtk`.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 `GtkTreeListRow`
-> 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 removed from its model at which point it will forever return 0.

## getExpanded

treeListRowGetExpanded Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeListRow a) |
=> a | `self`: a `GtkTreeListRow`
-> 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 `GtkTreeListRow`
-> m (Maybe Object) | Returns: The item of this row. This function is only marked as nullable for backwards compatibility reasons.

Gets the item corresponding to this row,

## getParent

treeListRowGetParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeListRow a) |
=> a | `self`: a `GtkTreeListRow`
-> 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 removed from its model at which point it will forever return `Nothing`.

## getPosition

treeListRowGetPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeListRow a) |
=> a | `self`: a `GtkTreeListRow`
-> m Word32 | Returns: The position in the model

Returns the position in the `GtkTreeListModel` that `self` occupies at the moment.

## isExpandable

treeListRowIsExpandable Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeListRow a) |
=> a | `self`: a `GtkTreeListRow`
-> 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 removed from its model at which point it will forever return `False`.

## setExpanded

treeListRowSetExpanded Source #

Arguments

:: (HasCallStack, MonadIO m, IsTreeListRow a) |
=> a | `self`: a `GtkTreeListRow`
-> 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 [callback`gtk`.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