Last chance! 50% off unlimited learning
Sale ends in
Last chance! 50% off unlimited learning
Sale ends in
gtkTreePathNew()
gtkTreePathNewFromString(path)
gtkTreePathNewFromIndices(...)
gtkTreePathToString(object)
gtkTreePathNewFirst()
gtkTreePathAppendIndex(object, index)
gtkTreePathPrependIndex(object, index)
gtkTreePathGetDepth(object)
gtkTreePathGetIndices(object)
gtkTreePathCopy(object)
gtkTreePathCompare(object, b)
gtkTreePathNext(object)
gtkTreePathPrev(object)
gtkTreePathUp(object)
gtkTreePathDown(object)
gtkTreePathIsAncestor(object, descendant)
gtkTreePathIsDescendant(object, ancestor)
gtkTreeRowReferenceNew(model, path)
gtkTreeRowReferenceNewProxy(proxy, model, path)
gtkTreeRowReferenceGetModel(object)
gtkTreeRowReferenceGetPath(object)
gtkTreeRowReferenceValid(object)
gtkTreeRowReferenceCopy(object)
gtkTreeRowReferenceInserted(proxy, path)
gtkTreeRowReferenceDeleted(proxy, path)
gtkTreeRowReferenceReordered(proxy, path, iter, new.order)
gtkTreeIterCopy(object)
gtkTreeModelGetFlags(object)
gtkTreeModelGetNColumns(object)
gtkTreeModelGetColumnType(object, index)
gtkTreeModelGetIter(object, path)
gtkTreeModelGetIterFromString(object, path.string)
gtkTreeModelGetIterFirst(object)
gtkTreeModelGetPath(object, iter)
gtkTreeModelGetValue(object, iter, column)
gtkTreeModelIterNext(object, iter)
gtkTreeModelIterChildren(object, parent = NULL)
gtkTreeModelIterHasChild(object, iter)
gtkTreeModelIterNChildren(object, iter = NULL)
gtkTreeModelIterNthChild(object, parent = NULL, n)
gtkTreeModelIterParent(object, child)
gtkTreeModelGetStringFromIter(object, iter)
gtkTreeModelRefNode(object, iter)
gtkTreeModelUnrefNode(object, iter)
gtkTreeModelGet(object, iter, ...)
gtkTreeModelForeach(object, func, user.data = NULL)
gtkTreeModelRowChanged(object, path, iter)
gtkTreeModelRowInserted(object, path, iter)
gtkTreeModelRowHasChildToggled(object, path, iter)
gtkTreeModelRowDeleted(object, path)
gtkTreeModelRowsReordered(object, path, iter, new.order)
gtkTreeModelGetIter
. These iterators are the primary way of
accessing a model and are similar to the iterators used by
GtkTreeIter
## Acquiring a GtkTreeIter## Three ways of getting the iter pointing to the location
## get the iterator from a string model$getIterFromString("3:2:5")$iter
## get the iterator from a path path <- gtkTreePathNewFromString("3:2:5") model$getIter(path)$iter
## walk the tree to find the iterator
parent_iter <- model$iterNthChild(NULL, 3)$iter
parent_iter <- model$iterNthChild(parent_iter, 2)$iter
model$iterNthChild(parent_iter, 5)$iter
This second example shows a quick way of iterating through a list and
getting a string and an integer from each row. The
populateModel
function used below is not shown, as
it is specific to the
Reading data from a GtkTreeModel
## Reading data from a GtkTreeModel
## make a new list_store list_store <- gtkListStore("character", "integer")
## Fill the list store with data populate_model(list_store)
## Get the first iter in the list result <- list_store$getIterFirst()
row_count <- 1 while(result[[1]]) { ## Walk through the list, reading each row data <- list_store$get(result$iter, 0, 1) ## Do something with the data print(paste("Row ", row_count, ": (", data[[1]], ",", data[[2]], ")", sep="")) row_count <- row_count + 1 result <- list_store$iterNext() }