func setAll(v *gtk.TreeStore, iter *gtk.TreeIter, values ...interface{}) { for i, val := range values { if val != nil { v.SetValue(iter, i, val) } } }
// 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 }
func getFromModelIter(m *gtk.TreeStore, iter *gtk.TreeIter, index int) string { val, _ := m.GetValue(iter, index) v, _ := val.GetString() return v }