GObject.Object
Gtk.TreeStore
Import line: | Gtk = imports.gi.Gtk; |
GIR File: | Gtk-3.0.gir |
C documentation: | GtkTreeStore |
Class : | TreeStore |
Implements: | Gtk.Buildable, Gtk.TreeDragDest, Gtk.TreeDragSource, Gtk.TreeModel, Gtk.TreeSortable |
Extends: | GObject.Object |
Properties | Defined By | |
---|---|---|
parent : GObject.Object
read only
|
Gtk.TreeStore | |
priv : Gtk.TreeStorePrivate
read only
|
Gtk.TreeStore |
Method / Constructor | Defined By | |
---|---|---|
new Gtk.TreeStore
(Object properties)
Create a new Gtk.TreeStore
Create a new Gtk.TreeStore
|
||
Creates a new tree store as with n_columns columns each of the types passed
in.
Creates a new tree store as with n_columns columns each of the types passed
in. Note that only types derived from standard GObject fundamental types are supported. As an example, GDK_TYPE_PIXBUF);
|
Gtk.TreeStore | |
Adds a child to buildable.
Adds a child to buildable. type is an optional string
describing how the child should be added.
|
Gtk.Buildable | |
Appends a new row to tree_store.
Appends a new row to tree_store. If parent is non-NULL, then it will append the
new row after the last child of parent, otherwise it will append a row to the top level. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value().
|
Gtk.TreeStore | |
clear
()
:
none
Removes all rows from tree_store
Removes all rows from tree_store
|
Gtk.TreeStore | |
Constructs a child of buildable with the name name.
Constructs a child of buildable with the name name.
GtkBuilder calls this function if a "constructor" has been specified in the UI definition.
|
Gtk.Buildable | |
This is similar to gtk_buildable_parser_finished() but is
called once for each custom tag handled by the buildable.
This is similar to gtk_buildable_parser_finished() but is
called once for each custom tag handled by the buildable.
|
Gtk.Buildable | |
This is called at the end of each custom element handled by
the buildable.
This is called at the end of each custom element handled by
the buildable.
|
Gtk.Buildable | |
This is called for each unknown element under <child>.
This is called for each unknown element under <child>.
if it doesn't.
|
Gtk.Buildable | |
Asks the GtkTreeDragSource to delete the row at path, because
it was moved somewhere else via drag-and-drop.
Asks the GtkTreeDragSource to delete the row at path, because
it was moved somewhere else via drag-and-drop. Returns FALSE if the deletion fails because path no longer exists, or for some model-specific reason. Should robustly handle a path no longer found in the model!
|
Gtk.TreeDragSource | |
Asks the GtkTreeDragSource to fill in selection_data with a
representation of the row at path.
Asks the GtkTreeDragSource to fill in selection_data with a
representation of the row at path. selection_data->target gives the required type of the data. Should robustly handle a path no longer found in the model!
|
Gtk.TreeDragSource | |
Asks the GtkTreeDragDest to insert a row before the path dest,
deriving the contents of the row from selection_data.
Asks the GtkTreeDragDest to insert a row before the path dest,
deriving the contents of the row from selection_data. If dest is outside the tree so that inserting before it is impossible, FALSE will be returned. Also, FALSE may be returned if the new row is not created for some model-specific reason. Should robustly handle a dest no longer found in the model!
|
Gtk.TreeDragDest | |
filter_new
(TreePath root)
:
Gtk.TreeModel
Creates a new GtkTreeModel, with child_model as the child_model
and root as the virtual root.
Creates a new GtkTreeModel, with child_model as the child_model
and root as the virtual root.
|
Gtk.TreeModel | |
Calls func on each node in model in a depth-first fashion.
Calls func on each node in model in a depth-first fashion.
If func returns TRUE, then the tree ceases to be walked, and gtk_tree_model_foreach() returns.
|
Gtk.TreeModel | |
Gtk.TreeModel | ||
get_flags
()
:
Gtk.TreeModelFlags
Returns a set of flags supported by this interface.
Returns a set of flags supported by this interface.
The flags are a bitwise combination of GtkTreeModelFlags. The flags supported should not change during the lifetime of the tree_model.
|
Gtk.TreeModel | |
Get the internal child called childname of the buildable object.
Get the internal child called childname of the buildable object.
|
Gtk.Buildable | |
Sets iter to a valid iterator pointing to path.
Sets iter to a valid iterator pointing to path.
|
Gtk.TreeModel | |
Initializes iter with the first iterator in the tree
(the one at the path "0") and returns TRUE.
Initializes iter with the first iterator in the tree
(the one at the path "0") and returns TRUE. Returns FALSE if the tree is empty.
|
Gtk.TreeModel | |
Sets iter to a valid iterator pointing to path_string, if it
exists.
Sets iter to a valid iterator pointing to path_string, if it
exists. Otherwise, iter is left invalid and FALSE is returned.
|
Gtk.TreeModel | |
get_n_columns
()
:
gint32
Returns the number of columns supported by tree_model.
Returns the number of columns supported by tree_model.
|
Gtk.TreeModel | |
get_name
()
:
String
Gets the name of the buildable object.
Gets the name of the buildable object.
GtkBuilder sets the name based on the the GtkBuilder UI definition used to construct the buildable.
|
Gtk.Buildable | |
get_path
(TreeIter iter)
:
Gtk.TreePath
Returns a newly-created GtkTreePath referenced by iter.
Returns a newly-created GtkTreePath referenced by iter.
This path should be freed with gtk_tree_path_free().
|
Gtk.TreeModel | |
Fills in sort_column_id and order with the current sort column and the
order.
Fills in sort_column_id and order with the current sort column and the
order. It returns TRUE unless the sort_column_id is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID. column ids.
|
Gtk.TreeSortable | |
Generates a string representation of the iter.
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. Must be freed with g_free().
|
Gtk.TreeModel | |
Initializes and sets value to that at column.
Initializes and sets value to that at column.
When done with value, g_value_unset() needs to be called to free any allocated memory.
|
Gtk.TreeModel | |
has_default_sort_func
()
:
gboolean
Returns TRUE if the model has a default sort function.
Returns TRUE if the model has a default sort function. This is used
primarily by GtkTreeViewColumns in order to determine if a model can go back to the default state, or not.
|
Gtk.TreeSortable | |
Creates a new row at position.
Creates a new row at position. If parent is non-NULL, then the row will be
made a child of parent. Otherwise, the row will be created at the toplevel. If position is larger than the number of rows at that level, then the new row will be inserted to the end of the list. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value().
|
Gtk.TreeStore | |
Inserts a new row after sibling.
Inserts a new row after sibling. If sibling is NULL, then the row will be
prepended to parent 's children. If parent and sibling are NULL, then the row will be prepended to the toplevel. If both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value().
|
Gtk.TreeStore | |
Inserts a new row before sibling.
Inserts a new row before sibling. If sibling is NULL, then the row will
be appended to parent 's children. If parent and sibling are NULL, then the row will be appended to the toplevel. If both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value().
|
Gtk.TreeStore | |
insert_with_values
(TreeIter iter, TreeIter parent, gint32 position, Array columns, Array values, gint32 n_values)
:
Gtk.TreeIter
Creates a new row at position.
Creates a new row at position. iter will be changed to point to this
new row. If position is larger than the number of rows on the list, then the new row will be appended to the list. The row will be filled with the values given to this function. Calling has the same effect as calling |[ gtk_tree_store_insert (tree_store, iter, position); gtk_tree_store_set (tree_store, iter, ...); ]| with the different that the former will only emit a row_inserted signal, while the latter will emit row_inserted, row_changed and if the tree store is sorted, rows_reordered. Since emitting the rows_reordered signal repeatedly can affect the performance of the program, gtk_tree_store_insert_with_values() should generally be preferred when inserting rows in a sorted tree store.
|
Gtk.TreeStore | |
Returns TRUE if iter is an ancestor of descendant.
Returns TRUE if iter is an ancestor of descendant. That is, iter is the
parent (or grandparent or great-grandparent) of descendant.
|
Gtk.TreeStore | |
Sets iter to point to the first child of parent.
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.TreeModel | |
Returns the depth of iter.
Returns the depth of iter. This will be 0 for anything on the root level, 1
for anything down a level, etc.
|
Gtk.TreeStore | |
Returns TRUE if iter has children, FALSE otherwise.
Returns TRUE if iter has children, FALSE otherwise.
|
Gtk.TreeModel | |
purposes.
purposes.
Checks if the given iter is a valid iter for this GtkTreeStore.
|
Gtk.TreeStore | |
Returns the number of children that iter has.
Returns the number of children that iter has.
As a special case, if iter is NULL, then the number of toplevel nodes is returned.
|
Gtk.TreeModel | |
Sets iter to point to the node following it at the current level.
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.
|
Gtk.TreeModel | |
Sets iter to be the child of parent, using the given index.
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, will remain a valid node after this function has been called. As a special case, if parent is NULL, then the nth root node is set.
|
Gtk.TreeModel | |
Sets iter to be the parent of child.
Sets iter to be the parent of child.
If child is at the toplevel, and doesn't have a parent, then called.
|
Gtk.TreeModel | |
Sets iter to point to the previous node at the current level.
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.
|
Gtk.TreeModel | |
Moves iter in tree_store to the position after position.
Moves iter in tree_store to the position after position. iter and
works with unsorted stores. If position is NULL, iter will be moved to the start of the level.
|
Gtk.TreeStore | |
Moves iter in tree_store to the position before position.
Moves iter in tree_store to the position before position. iter and
works with unsorted stores. If position is NULL, iter will be moved to the end of the level.
|
Gtk.TreeStore | |
parser_finished
(Builder builder)
:
none
Called when the builder finishes the parsing of a
GtkBuilder UI definition.
Called when the builder finishes the parsing of a
GtkBuilder UI definition. Note that this will be called once for each time gtk_builder_add_from_file() or gtk_builder_add_from_string() is called on a builder.
|
Gtk.Buildable | |
Prepends a new row to tree_store.
Prepends a new row to tree_store. If parent is non-NULL, then it will prepend
the new row before the first child of parent, otherwise it will prepend a row to the top level. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or gtk_tree_store_set_value().
|
Gtk.TreeStore | |
ref_node
(TreeIter iter)
:
none
Lets the tree ref the node.
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). 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.
|
Gtk.TreeModel | |
Removes iter from tree_store.
Removes iter from tree_store. After being removed, iter is set to the
next valid row at that level, or invalidated if it previously pointed to the last one.
|
Gtk.TreeStore | |
Emits the GtkTreeModel::row-changed signal on tree_model.
Emits the GtkTreeModel::row-changed signal on tree_model.
|
Gtk.TreeModel | |
row_deleted
(TreePath path)
:
none
Emits the GtkTreeModel::row-deleted signal on tree_model.
Emits the GtkTreeModel::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.
|
Gtk.TreeModel | |
Asks the GtkTreeDragSource whether a particular row can be used as
the source of a DND operation.
Asks the GtkTreeDragSource whether a particular row can be used as
the source of a DND operation. If the source doesn't implement this interface, the row is assumed draggable.
|
Gtk.TreeDragSource | |
Determines whether a drop is possible before the given dest_path,
at the same depth as dest_path.
Determines whether a drop is possible before the given dest_path,
at the same depth as dest_path. i.e., can we drop the data in exist; the return value will almost certainly be FALSE if the parent of dest_path doesn't exist, though.
|
Gtk.TreeDragDest | |
Emits the GtkTreeModel::row-has-child-toggled signal on
state of a node changes.
Emits the GtkTreeModel::row-has-child-toggled signal on
state of a node changes.
|
Gtk.TreeModel | |
Emits the GtkTreeModel::row-inserted signal on tree_model.
Emits the GtkTreeModel::row-inserted signal on tree_model.
|
Gtk.TreeModel | |
Sets the value of one or more cells in the row referenced by iter.
Sets the value of one or more cells in the row referenced by iter.
The variable argument list should contain integer column numbers, each column number followed by the value to be set. The list is terminated by a -1. For example, to set column 0 with type G_TYPE_STRING to "Foo", you would write The value will be referenced by the store if it is a G_TYPE_OBJECT, and it will be copied if it is a G_TYPE_STRING or G_TYPE_BOXED.
|
Gtk.TreeStore | |
Sets the property name name to value on the buildable object.
Sets the property name name to value on the buildable object.
|
Gtk.Buildable | |
This function is meant primarily for GObjects that inherit from
GtkTreeStore, and should only be used when constructing a new GtkTreeStore.
This function is meant primarily for GObjects that inherit from
GtkTreeStore, and should only be used when constructing a new GtkTreeStore. It will not function after a row has been added, or a method on the GtkTreeModel interface is called.
|
Gtk.TreeStore | |
Sets the default comparison function used when sorting to be sort_func.
Sets the default comparison function used when sorting to be sort_func.
If the current sort column id of sortable is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using this function. If sort_func is NULL, then there will be no default comparison function. This means that once the model has been sorted, it can't go back to the default state. In this case, when the current sort column id of sortable is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
|
Gtk.TreeSortable | |
set_name
(String name)
:
none
Sets the name of the buildable object.
Sets the name of the buildable object.
|
Gtk.Buildable | |
Sets the current sort column to be sort_column_id.
Sets the current sort column to be sort_column_id. The sortable will
resort itself to reflect this change, after emitting a GtkTreeSortable::sort-column-changed signal. sort_column_id may either be a regular column id, or one of the following special values:
|
Gtk.TreeSortable | |
Sets the comparison function used when sorting to be sort_func.
Sets the comparison function used when sorting to be sort_func. If the
current sort column id of sortable is the same as sort_column_id, then the model will sort using this function.
|
Gtk.TreeSortable | |
Sets the data in the cell specified by iter and column.
Sets the data in the cell specified by iter and column.
The type of value must be convertible to the type of the column.
|
Gtk.TreeStore | |
sort_column_changed
()
:
none
Emits a GtkTreeSortable::sort-column-changed signal on sortable.
Emits a GtkTreeSortable::sort-column-changed signal on sortable.
|
Gtk.TreeSortable | |
sort_new_with_model
()
:
Gtk.TreeModel
Creates a new GtkTreeModel, with child_model as the child model.
Creates a new GtkTreeModel, with child_model as the child model.
|
Gtk.TreeModel | |
Swaps a and b in the same level of tree_store.
Swaps a and b in the same level of tree_store. Note that this function
only works with unsorted stores.
|
Gtk.TreeStore | |
unref_node
(TreeIter iter)
:
none
Lets the tree unref the node.
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.
|
Gtk.TreeModel |
Event | Defined By | |
---|---|---|
This signal is emitted when a row in the model has changed.
This signal is emitted when a row in the model has changed.
|
Gtk.TreeModel | |
This signal is emitted when a row has been deleted.
This signal is emitted when a row has been deleted.
Note that no iterator is passed to the signal handler, since the row is already 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.
|
Gtk.TreeModel | |
This signal is emitted when a row has gotten the first child
row or lost its last child row.
This signal is emitted when a row has gotten the first child
row or lost its last child row.
|
Gtk.TreeModel | |
This signal is emitted when a new row has been inserted in
the model.
This signal is emitted when a new row has been inserted in
the model. Note that the row may still be empty at this point, since it is a common pattern to first insert an empty row, and then fill it with the desired values.
|
Gtk.TreeModel | |
sort_column_changed (TreeSortable self)
:
none
The ::sort-column-changed signal is emitted when the sort column
or sort order of sortable is changed.
The ::sort-column-changed signal is emitted when the sort column
or sort order of sortable is changed. The signal is emitted before the contents of sortable are resorted.
|
Gtk.TreeSortable |