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.Structs.TreePath

Contents

- Exported types
- Methods
  - appendIndex
  - compare
  - copy
  - down
  - free
  - getDepth
  - getIndices
  - isAncestor
  - isDescendant
  - new
  - newFirst
  - newFromIndices
  - newFromString
  - next
  - prependIndex
  - prev
  - toString
  - up

Description

An opaque structure representing a path to a row in a model.

Synopsis

- newtype TreePath = TreePath (ManagedPtr TreePath)
- treePathAppendIndex :: (HasCallStack, MonadIO m) => TreePath -> Int32 -> m ()
- treePathCompare :: (HasCallStack, MonadIO m) => TreePath -> TreePath -> m Int32
- treePathCopy :: (HasCallStack, MonadIO m) => TreePath -> m TreePath
- treePathDown :: (HasCallStack, MonadIO m) => TreePath -> m ()
- treePathFree :: (HasCallStack, MonadIO m) => Maybe TreePath -> m ()
- treePathGetDepth :: (HasCallStack, MonadIO m) => TreePath -> m Int32
- treePathGetIndices :: (HasCallStack, MonadIO m) => TreePath -> m (Maybe [Int32])
- treePathIsAncestor :: (HasCallStack, MonadIO m) => TreePath -> TreePath -> m Bool
- treePathIsDescendant :: (HasCallStack, MonadIO m) => TreePath -> TreePath -> m Bool
- treePathNew :: (HasCallStack, MonadIO m) => m TreePath
- treePathNewFirst :: (HasCallStack, MonadIO m) => m TreePath
- treePathNewFromIndices :: (HasCallStack, MonadIO m) => [Int32] -> m TreePath
- treePathNewFromString :: (HasCallStack, MonadIO m) => Text -> m (Maybe TreePath)
- treePathNext :: (HasCallStack, MonadIO m) => TreePath -> m ()
- treePathPrependIndex :: (HasCallStack, MonadIO m) => TreePath -> Int32 -> m ()
- treePathPrev :: (HasCallStack, MonadIO m) => TreePath -> m Bool
- treePathToString :: (HasCallStack, MonadIO m) => TreePath -> m (Maybe Text)
- treePathUp :: (HasCallStack, MonadIO m) => TreePath -> m Bool

# Exported types

newtype TreePath Source #

Memory-managed wrapper type.

Constructors

TreePath (ManagedPtr TreePath) |

#### Instances

Instances details

Eq TreePath Source # |
Instance details Defined in GI.Gtk.Structs.TreePath Methods (==) :: TreePath -> TreePath -> Bool Source # (/=) :: TreePath -> TreePath -> Bool Source #
GBoxed TreePath Source # |
Instance details Defined in GI.Gtk.Structs.TreePath
ManagedPtrNewtype TreePath Source # |
Instance details Defined in GI.Gtk.Structs.TreePath Methods toManagedPtr :: TreePath -> ManagedPtr TreePath Source #
TypedObject TreePath Source # |
Instance details Defined in GI.Gtk.Structs.TreePath Methods glibType :: IO GType Source #
HasParentTypes TreePath Source # |
Instance details Defined in GI.Gtk.Structs.TreePath
IsGValue (Maybe TreePath) Source # | Convert `TreePath` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Structs.TreePath Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe TreePath -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe TreePath) Source #
type ParentTypes TreePath Source # |
Instance details Defined in GI.Gtk.Structs.TreePath type ParentTypes TreePath = '[] :: [Type]

# Methods

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

Expand

#### Methods

appendIndex, compare, copy, down, free, isAncestor, isDescendant, next, prependIndex, prev, toString, up.

#### Getters

getDepth, getIndices.

#### Setters

None.

## appendIndex

treePathAppendIndex Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> Int32 | `index_`: the index
-> m () |

Deprecated: (Since version 4.10)

Appends a new index to a path.

As a result, the depth of the path is increased.

## compare

treePathCompare Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `a`: a `GtkTreePath`
-> TreePath | `b`: a `GtkTreePath` to compare with
-> m Int32 | Returns: the relative positions of `a` and `b`

Deprecated: (Since version 4.10)

Compares two paths.

If `a` appears before `b` in a tree, then -1 is returned. If `b` appears before `a`, then 1 is returned. If the two nodes are equal, then 0 is returned.

## copy

treePathCopy Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> m TreePath | Returns: a new `GtkTreePath`

Deprecated: (Since version 4.10)

Creates a new `GtkTreePath` as a copy of `path`.

## down

treePathDown Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> m () |

Deprecated: (Since version 4.10)

Moves `path` to point to the first child of the current path.

## free

treePathFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Maybe TreePath | `path`: a `GtkTreePath`
-> m () |

Deprecated: (Since version 4.10)

Frees `path`. If `path` is `Nothing`, it simply returns.

## getDepth

treePathGetDepth Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> m Int32 | Returns: The depth of `path`

Deprecated: (Since version 4.10)

Returns the current depth of `path`.

## getIndices

treePathGetIndices Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> m (Maybe [Int32]) | Returns: The current indices

Deprecated: (Since version 4.10)

Returns the current indices of `path`.

This is an array of integers, each representing a node in a tree. It also returns the number of elements in the array. The array should not be freed.

## isAncestor

treePathIsAncestor Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> TreePath | `descendant`: another `GtkTreePath`
-> m Bool | Returns: `True` if `descendant` is contained inside `path`

Deprecated: (Since version 4.10)

Returns `True` if `descendant` is a descendant of `path`.

## isDescendant

treePathIsDescendant Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> TreePath | `ancestor`: another `GtkTreePath`
-> m Bool | Returns: `True` if `ancestor` contains `path` somewhere below it

Deprecated: (Since version 4.10)

Returns `True` if `path` is a descendant of `ancestor`.

## new

treePathNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m TreePath | Returns: A newly created `GtkTreePath`.

Deprecated: (Since version 4.10)

Creates a new `GtkTreePath` This refers to a row.

## newFirst

treePathNewFirst Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m TreePath | Returns: A new `GtkTreePath`

Deprecated: (Since version 4.10)

Creates a new `GtkTreePath`.

The string representation of this path is “0”.

## newFromIndices

treePathNewFromIndices Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> [Int32] | `indices`: array of indices
-> m TreePath | Returns: A newly created `GtkTreePath`

Deprecated: (Since version 4.10)

Creates a new path with the given `indices` array of `length`.

## newFromString

treePathNewFromString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `path`: The string representation of a path
-> m (Maybe TreePath) | Returns: A newly-created `GtkTreePath`

Deprecated: (Since version 4.10)

Creates a new `GtkTreePath` initialized to `path`.

`path` is expected to be a colon separated list of numbers. For example, the string “10:4:0” would create a path of depth 3 pointing to the 11th child of the root node, the 5th child of that 11th child, and the 1st child of that 5th child. If an invalid path string is passed in, `Nothing` is returned.

## next

treePathNext Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> m () |

Deprecated: (Since version 4.10)

Moves the `path` to point to the next node at the current depth.

## prependIndex

treePathPrependIndex Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> Int32 | `index_`: the index
-> m () |

Deprecated: (Since version 4.10)

Prepends a new index to a path.

As a result, the depth of the path is increased.

## prev

treePathPrev Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> m Bool | Returns: `True` if `path` has a previous node, and the move was made

Deprecated: (Since version 4.10)

Moves the `path` to point to the previous node at the current depth, if it exists.

## toString

treePathToString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> m (Maybe Text) | Returns: A newly-allocated string

Deprecated: (Since version 4.10)

Generates a string representation of the path.

This string is a “:” separated list of numbers. For example, “4:10:0:3” would be an acceptable return value for this string. If the path has depth 0, `Nothing` is returned.

## up

treePathUp Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> TreePath | `path`: a `GtkTreePath`
-> m Bool | Returns: `True` if `path` has a parent, and the move was made

Deprecated: (Since version 4.10)

Moves the `path` to point to its parent node, if it has a parent.