Class TreePath

All Implemented Interfaces:
PointerInterface

public class TreePath extends Record
An opaque structure representing a path to a row in a model.

https://docs.gtk.org/gtk4/struct.TreePath.html

  • Constructor Details

    • TreePath

      public TreePath(PointerContainer pointer)
    • TreePath

      public TreePath()
      Creates a new `GtkTreePath`
      This refers to a row.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newFirstTreePath

      public static TreePath newFirstTreePath()
      Creates a new `GtkTreePath`.

      The string representation of this path is “0”.
      Returns:
      A new `GtkTreePath`
    • newFromIndicesTreePath

      public static TreePath newFromIndicesTreePath(int first_index, Object... _elipse)
      Creates a new path with @first_index and @varargs as indices.
      Parameters:
      first_index - first integer
      _elipse - list of integers terminated by -1
      Returns:
      A newly created `GtkTreePath`
    • newFromIndicesvTreePath

      public static TreePath newFromIndicesvTreePath(@Nonnull Int indices, long length)
      Creates a new path with the given @indices array of @length.
      Parameters:
      indices - array of indices
      length - length of @indices array
      Returns:
      A newly created `GtkTreePath`
    • newFromStringTreePath

      public static TreePath newFromStringTreePath(@Nonnull Str path)
      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, %NULL is returned.
      Parameters:
      path - The string representation of a path
      Returns:
      A newly-created `GtkTreePath`
    • newFromStringTreePath

      public static TreePath newFromStringTreePath(String path)
      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, %NULL is returned.
      Parameters:
      path - The string representation of a path
      Returns:
      A newly-created `GtkTreePath`
    • appendIndex

      public void appendIndex(int index_)
      Appends a new index to a path.

      As a result, the depth of the path is increased.
      Parameters:
      index_ - the index
    • compare

      public int compare(@Nonnull TreePath 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.
      Parameters:
      b - a `GtkTreePath` to compare with
      Returns:
      the relative positions of @a and @b
    • copy

      public TreePath copy()
      Creates a new `GtkTreePath` as a copy of @path.
      Returns:
      a new `GtkTreePath`
    • down

      public void down()
      Moves @path to point to the first child of the current path.
    • free

      public void free()
      Frees @path. If @path is %NULL, it simply returns.
    • getDepth

      public int getDepth()
      Returns the current depth of @path.
      Returns:
      The depth of @path
    • getIndices

      public Int getIndices()
      Returns the current indices of @path.

      This is an array of integers, each representing a node in a tree.
      This value should not be freed.

      The length of the array can be obtained with gtk_tree_path_get_depth().
      Returns:
      The current indices
    • getIndicesWithDepth

      public Int getIndicesWithDepth(@Nullable Int depth)
      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.
      Parameters:
      depth - return location for number of elements returned in the integer array
      Returns:
      The current indices
    • isAncestor

      public boolean isAncestor(@Nonnull TreePath descendant)
      Returns %TRUE if @descendant is a descendant of @path.
      Parameters:
      descendant - another `GtkTreePath`
      Returns:
      %TRUE if @descendant is contained inside @path
    • isDescendant

      public boolean isDescendant(@Nonnull TreePath ancestor)
      Returns %TRUE if @path is a descendant of @ancestor.
      Parameters:
      ancestor - another `GtkTreePath`
      Returns:
      %TRUE if @ancestor contains @path somewhere below it
    • next

      public void next()
      Moves the @path to point to the next node at the current depth.
    • prependIndex

      public void prependIndex(int index_)
      Prepends a new index to a path.

      As a result, the depth of the path is increased.
      Parameters:
      index_ - the index
    • prev

      public boolean prev()
      Moves the @path to point to the previous node at the
      current depth, if it exists.
      Returns:
      %TRUE if @path has a previous node, and the move was made
    • toStr

      public Str toStr()
      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, %NULL is returned.
      Returns:
      A newly-allocated string
    • up

      public boolean up()
      Moves the @path to point to its parent node, if it has a parent.
      Returns:
      %TRUE if @path has a parent, and the move was made
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()