示例#1
0
文件: gunvalue.go 项目: sqp/godock
// SelectedValue returns the liststore row value for the selected line as converter.
//
func SelectedValue(model *gtk.ListStore, selection *gtk.TreeSelection, row int) Conv {
	iter, e := SelectedIter(model, selection)
	if e != nil {
		return Conv{err: e}
	}
	return New(model.GetValue(iter, row))
}
示例#2
0
文件: others.go 项目: sqp/godock
// getActiveRowInCombo gets the value of the current RowKey in the store.
//
func getActiveRowInCombo(model *gtk.ListStore, iter *gtk.TreeIter) (string, error) {
	if iter == nil {
		return "", errors.New("getActiveRowInCombo: no selection")
	}
	str, e := gunvalue.New(model.GetValue(iter, RowKey)).String()
	if e != nil {
		return "", e
	}

	// if (cValue == NULL && GTK_IS_COMBO_BOX (pOneWidget) && gtk_combo_box_get_has_entry (GTK_COMBO_BOX (pOneWidget)))
	// {
	// 	GtkWidget *pEntry = gtk_bin_get_child (GTK_BIN (pOneWidget));
	// 	cValue = g_strdup (gtk_entry_get_text (GTK_ENTRY (pEntry)));
	// }
	return str, nil
}
示例#3
0
func valAt(s *gtk.ListStore, iter *gtk.TreeIter, col int) interface{} {
	gv, _ := s.GetValue(iter, col)
	vv, _ := gv.GoValue()
	return vv
}