gtk.TreeModelRow — an object representing a row in a gtk.TreeModel
|
A gtk.TreeModelRow object represents a row in a gtk.TreeModel. A gtk.TreeModelRow is created by taking the mapping of a gtk.TreeModel. For example:
treemodelrow = liststore[0] treemodelrow = liststore[(0,)] treemodelrow = liststore['0'] |
all create a gtk.TreeModelRow for the first row in liststore. The gtk.TreeModelRow implements 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:
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.TreeModelRow supports one method: the iterchildren() method that returns a gtk.TreeModelRowIter for iterating over the children of the row.
|
Returns : | a gtk.TreeModelRowIter for the row's children or None |
The iterchildren() method returns a gtk.TreeModelRowIter for iterating over the children of the row or None if the row has no children.