Gtk.TreeModelRow¶
Class Details¶
- class Gtk.TreeModelRow(model, iter_or_path)¶
A
Gtk.TreeModelRowobject represents a row in aGtk.TreeModel. AGtk.TreeModelRowis created by taking the mapping of aGtk.TreeModel. For example:treemodelrow = liststore[0] treemodelrow = liststore[(0,)] treemodelrow = liststore['0']
all create a
Gtk.TreeModelRowfor the first row in liststore. TheGtk.TreeModelRowimplements some of the Python sequence protocol that makes the row behave like a sequence of objects. Specifically a tree model row has the capability of:getting and setting column values,
returning a tuple or list containing the column values, and
getting the number of values in the row i.e. the number of columns
For example to get and set the value in the second column of a row, you could do the following:
value = treemodelrow[1] treemodelrow[1] = value
You can use the Python len() function to get the number of columns in the row and you can retrieve all the column values as a list (tuple) using the Python list() (tuple()) function.
The
Gtk.TreeModelRowsupports one method: the iterchildren() method that returns aGtk.TreeModelRowIterfor iterating over the children of the row.- iter¶
A
Gtk.TreeIterpointing at the row
- model¶
The
Gtk.TreeModelthat the row is part of
- next¶
The next
Gtk.TreeModelRowor None
- parent¶
The parent
Gtk.TreeModelRowor htis row or None
- path¶
The tree path of the row
- previous¶
The previous
Gtk.TreeModelRowor None
- get_next()¶
Returns the next
Gtk.TreeModelRowor None
- get_parent()¶
Returns the parent
Gtk.TreeModelRowor htis row or None
- get_previous()¶
Returns the previous
Gtk.TreeModelRowor None
- iterchildren()¶
Returns a
Gtk.TreeModelRowIterfor the row’s children