package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Tree_model

type t = [ `tree_model ] Gobject.obj
val from_gobject : 'a Gobject.obj -> t
val unref_node : t -> [ `tree_iter ] Gobject.obj -> unit

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.

val rows_reordered_with_length : t -> [ `tree_path ] Gobject.obj -> [ `tree_iter ] Gobject.obj option -> int array -> int -> unit

Emits the ::rows-reordered signal on @tree_model.

See signal@Gtk.TreeModel::rows-reordered.

This should be called by models when their rows have been reordered.

val row_inserted : t -> [ `tree_path ] Gobject.obj -> [ `tree_iter ] Gobject.obj -> unit

Emits the ::row-inserted signal on @tree_model.

See signal@Gtk.TreeModel::row-inserted.

val row_has_child_toggled : t -> [ `tree_path ] Gobject.obj -> [ `tree_iter ] Gobject.obj -> unit

Emits the ::row-has-child-toggled signal on @tree_model.

See signal@Gtk.TreeModel::row-has-child-toggled.

This should be called by models after the child state of a node changes.

val row_deleted : t -> [ `tree_path ] Gobject.obj -> unit

Emits the ::row-deleted signal on @tree_model.

See signal@Gtk.TreeModel::row-deleted.

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.

val row_changed : t -> [ `tree_path ] Gobject.obj -> [ `tree_iter ] Gobject.obj -> unit

Emits the ::row-changed signal on @tree_model.

See signal@Gtk.TreeModel::row-changed.

val ref_node : t -> [ `tree_iter ] Gobject.obj -> unit

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.

val iter_previous : t -> [ `tree_iter ] Gobject.obj -> bool

Sets @iter to point to the previous node at the current level.

If there is no previous @iter, %FALSE is returned and @iter is set to be invalid.

val iter_parent : t -> [ `tree_iter ] Gobject.obj -> bool * [ `tree_iter ] Gobject.obj

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.

val iter_nth_child : t -> [ `tree_iter ] Gobject.obj option -> int -> bool * [ `tree_iter ] Gobject.obj

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.

val iter_next : t -> [ `tree_iter ] Gobject.obj -> bool

Sets @iter to point to the node following it at the current level.

If there is no next @iter, %FALSE is returned and @iter is set to be invalid.

val iter_n_children : t -> [ `tree_iter ] Gobject.obj option -> int

Returns the number of children that @iter has.

As a special case, if @iter is %NULL, then the number of toplevel nodes is returned.

val iter_has_child : t -> [ `tree_iter ] Gobject.obj -> bool

Returns %TRUE if @iter has children, %FALSE otherwise.

val iter_children : t -> [ `tree_iter ] Gobject.obj option -> bool * [ `tree_iter ] Gobject.obj

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);`

val get_value : t -> [ `tree_iter ] Gobject.obj -> int -> Gobject.Value.t

Initializes and sets @value to that at @column.

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

val get_string_from_iter : t -> [ `tree_iter ] Gobject.obj -> string option

Generates a string representation of the iter.

This string is a “:” separated list of numbers. For example, “4:10:0:3” would be an acceptable return value for this string.

val get_path : t -> [ `tree_iter ] Gobject.obj -> [ `tree_path ] Gobject.obj

Returns a newly-created `GtkTreePath` referenced by @iter.

This path should be freed with gtk_tree_path_free().

val get_n_columns : t -> int

Returns the number of columns supported by @tree_model.

val get_iter_from_string : t -> string -> bool * [ `tree_iter ] Gobject.obj

Sets @iter to a valid iterator pointing to @path_string, if it exists.

Otherwise, @iter is left invalid and %FALSE is returned.

val get_iter_first : t -> bool * [ `tree_iter ] Gobject.obj

Initializes @iter with the first iterator in the tree (the one at the path "0").

Returns %FALSE if the tree is empty, %TRUE otherwise.

val get_iter : t -> [ `tree_path ] Gobject.obj -> bool * [ `tree_iter ] Gobject.obj

Sets @iter to a valid iterator pointing to @path.

If @path does not exist, @iter is set to an invalid iterator and %FALSE is returned.

val get_flags : t -> Gtk_enums.treemodelflags

Returns a set of flags supported by this interface.

The flags are a bitwise combination of `GtkTreeModel`Flags. The flags supported should not change during the lifetime of the @tree_model.

val get_column_type : t -> int -> Gobject.Type.t

Returns the type of the column.

val filter_new : t -> [ `tree_path ] Gobject.obj option -> t

Creates a new `GtkTreeModel`, with @child_model as the child_model and @root as the virtual root.