本文整理匯總了Golang中github.com/gotk3/gotk3/gtk.TreeStore類的典型用法代碼示例。如果您正苦於以下問題:Golang TreeStore類的具體用法?Golang TreeStore怎麽用?Golang TreeStore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了TreeStore類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: setAll
func setAll(v *gtk.TreeStore, iter *gtk.TreeIter, values ...interface{}) {
for i, val := range values {
if val != nil {
v.SetValue(iter, i, val)
}
}
}
示例2: addSubRow
// Append a sub row to the tree store for the tree view
func addSubRow(treeStore *gtk.TreeStore, iter *gtk.TreeIter, icon *gdk.Pixbuf, text string) *gtk.TreeIter {
// Get an iterator for a new row at the end of the list store
i := treeStore.Append(iter)
// Set the contents of the tree store row that the iterator represents
err := treeStore.SetValue(i, COLUMN_ICON, icon)
if err != nil {
log.Fatal("Unable set value:", err)
}
err = treeStore.SetValue(i, COLUMN_TEXT, text)
if err != nil {
log.Fatal("Unable set value:", err)
}
return i
}
示例3: getFromModelIter
func getFromModelIter(m *gtk.TreeStore, iter *gtk.TreeIter, index int) string {
val, _ := m.GetValue(iter, index)
v, _ := val.GetString()
return v
}