gi-gtk-3.0.43: Gtk 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

No description available in the introspection data.

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 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 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 `TreePath`-struct
-> Int32 | `index_`: the index
-> m () |

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 `TreePath`-struct
-> TreePath | `b`: a `TreePath`-struct to compare with
-> m Int32 | Returns: the relative positions of `a` and `b`

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 `TreePath`-struct
-> m TreePath | Returns: a new `TreePath`-struct

Creates a new `TreePath`-struct as a copy of `path`.

## down

treePathDown Source #

Arguments

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

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

## free

treePathFree Source #

Arguments

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

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

## getDepth

treePathGetDepth Source #

Arguments

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

Returns the current depth of `path`.

## getIndices

treePathGetIndices Source #

Arguments

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

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.

Since: 3.0

## isAncestor

treePathIsAncestor Source #

Arguments

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

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

## isDescendant

treePathIsDescendant Source #

Arguments

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

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

## new

treePathNew Source #

Arguments

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

Creates a new `TreePath`-struct. This refers to a row.

## newFirst

treePathNewFirst Source #

Arguments

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

Creates a new `TreePath`-struct.

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 `TreePath`-struct

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

Since: 3.12

## newFromString

treePathNewFromString Source #

Arguments

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

Creates a new `TreePath`-struct 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 `TreePath`-struct
-> m () |

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

## prependIndex

treePathPrependIndex Source #

Arguments

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

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 `TreePath`-struct
-> m Bool | Returns: `True` if `path` has a previous node, and the move was made

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 `TreePath`-struct
-> m Text | Returns: A newly-allocated string. Must be freed with `free`.

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.

## up

treePathUp Source #

Arguments

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

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