Class TreeListRow

All Implemented Interfaces:
PointerInterface

public class TreeListRow extends Object
`GtkTreeListRow` is used by `GtkTreeListModel` to represent items.

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

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

There are various support objects that can make use of `GtkTreeListRow`
objects, such as the [class@Gtk.TreeExpander] widget that allows displaying
an icon to expand or collapse a row or [class@Gtk.TreeListRowSorter] that
makes it possible to sort trees properly.

https://docs.gtk.org/gtk4/class.TreeListRow.html

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getChildRow

      public TreeListRow getChildRow(int position)
      If @self is not expanded or @position is greater than the
      number of children, %NULL is returned.
      Parameters:
      position - position of the child to get
      Returns:
      the child in @position
    • getChildren

      public ListModel getChildren()
      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
      [property@Gtk.TreeListModel:passthrough] is set to.
      Returns:
      The model containing the children
    • getDepth

      public int getDepth()
      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 destroyed.
      Returns:
      The depth of this row
    • getExpanded

      public boolean getExpanded()
      Gets if a row is currently expanded.
      Returns:
      %TRUE if the row is expanded
    • getItem

      public Pointer getItem()
      Gets the item corresponding to this row,

      The value returned by this function never changes until the
      row is destroyed.
      Returns:
      The item of this row or %NULL when the row was destroyed
    • getParent

      public TreeListRow getParent()
      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,
      %NULL is returned.

      The value returned by this function never changes
      until the row is destroyed.
      Returns:
      The parent of @self
    • getPosition

      public int getPosition()
      Returns the position in the `GtkTreeListModel` that @self occupies
      at the moment.
      Returns:
      The position in the model
    • isExpandable

      public boolean isExpandable()
      Checks if a row can be expanded.

      This does not mean that the row is actually expanded,
      this can be checked with [method@Gtk.TreeListRow.get_expanded].

      If a row is expandable never changes until the row is destroyed.
      Returns:
      %TRUE if the row is expandable
    • setExpanded

      public void setExpanded(boolean expanded)
      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.
      Parameters:
      expanded - %TRUE if the row should be expanded
    • 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()