Interface

Gtk-3.0GtkTreeModelInterface

Interface for implementing TreeModel. Contains only the virtual methods that need to be implemented.

interface Interface {
    vfunc_get_column_type(index_: number): GType;
    vfunc_get_flags(): Gtk.TreeModelFlags;
    vfunc_get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter];
    vfunc_get_n_columns(): number;
    vfunc_get_path(iter: Gtk.TreeIter): Gtk.TreePath;
    vfunc_get_value(iter: Gtk.TreeIter, column: number): unknown;
    vfunc_iter_children(parent?: Gtk.TreeIter): [boolean, Gtk.TreeIter];
    vfunc_iter_has_child(iter: Gtk.TreeIter): boolean;
    vfunc_iter_n_children(iter?: Gtk.TreeIter): number;
    vfunc_iter_next(iter: Gtk.TreeIter): boolean;
    vfunc_iter_nth_child(
        parent: Gtk.TreeIter,
        n: number,
    ): [boolean, Gtk.TreeIter];
    vfunc_iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter];
    vfunc_iter_previous(iter: Gtk.TreeIter): boolean;
    vfunc_ref_node(iter: Gtk.TreeIter): void;
    vfunc_row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
    vfunc_row_deleted(path: Gtk.TreePath): void;
    vfunc_row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
    vfunc_row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void;
    vfunc_unref_node(iter: Gtk.TreeIter): void;
}

Hierarchy (View Summary)

Index

Methods

  • Returns the number of columns supported by tree_model.

    Returns number

  • Initializes and sets value to that at column.

    When done with value, g_value_unset() needs to be called to free any allocated memory.

    Parameters

    Returns unknown

  • Sets iter to point to the first child of parent.

    If parent has no children, false is returned and iter is set to be invalid. parent will remain a valid node after this function has been called.

    If parent is null returns the first node, equivalent to gtk_tree_model_get_iter_first (tree_model, iter);

    Parameters

    Returns [boolean, Gtk.TreeIter]

  • Sets iter to be the child of parent, using the given index.

    The first index is 0. If n is too big, or parent has no children, iter is set to an invalid iterator and false is returned. parent will remain a valid node after this function has been called. As a special case, if parent is null, then the n-th root node is set.

    Parameters

    • parent: Gtk.TreeIter

      the Gtk.TreeIter-struct to get the child from, or null.

    • n: number

      the index of the desired child

    Returns [boolean, Gtk.TreeIter]

  • Sets iter to be the parent of child.

    If child is at the toplevel, and doesn’t have a parent, then iter is set to an invalid iterator and false is returned. child will remain a valid node after this function has been called.

    iter will be initialized before the lookup is performed, so child and iter cannot point to the same memory location.

    Parameters

    Returns [boolean, Gtk.TreeIter]

  • Lets the tree ref the node.

    This is an optional method for models to implement. To be more specific, models may ignore this call as it exists primarily for performance reasons.

    This function is primarily meant as a way for views to let caching models know when nodes are being displayed (and hence, whether or not to cache that node). Being displayed means a node is in an expanded branch, regardless of whether the node is currently visible in the viewport. For example, a file-system based model would not want to keep the entire file-hierarchy in memory, just the sections that are currently being displayed by every current view.

    A model should be expected to be able to get an iter independent of its reffed state.

    Parameters

    Returns void

  • Emits the Gtk.TreeModel.SignalSignatures.row_deleted | Gtk.TreeModel::row-deleted signal on tree_model.

    This should be called by models after a row has been removed. The location pointed to by path should be the location that the row previously was at. It may not be a valid location anymore.

    Nodes that are deleted are not unreffed, this means that any outstanding references on the deleted node should not be released.

    Parameters

    Returns void

  • Lets the tree unref the node.

    This is an optional method for models to implement. To be more specific, models may ignore this call as it exists primarily for performance reasons. For more information on what this means, see gtk_tree_model_ref_node().

    Please note that nodes that are deleted are not unreffed.

    Parameters

    Returns void