From a7ec908ebd5e344628717cab874919dfc29cd58c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 9 Mar 2014 11:36:44 -0400 Subject: [PATCH] Removed gListboxSelected; it was never being called anyway (only gListboxSelectedMulti is; Windows still uses selectedIndex() for Listbox because of differences in how multi-selection listboxes are handled there and Mac OS X never had this function written to begin with). --- listbox_unix.go | 15 --------------- sysdata_unix.go | 1 - 2 files changed, 16 deletions(-) diff --git a/listbox_unix.go b/listbox_unix.go index cc6ca44..d3615f1 100644 --- a/listbox_unix.go +++ b/listbox_unix.go @@ -136,21 +136,6 @@ func gListboxInsert(widget *gtkWidget, index int, what string) { C.gtkListStoreSet(ls, &iter, cwhat) } -func gListboxSelected(widget *gtkWidget) int { - var model *C.GtkTreeModel - var iter C.GtkTreeIter - - tv := getTreeViewFrom(widget) - sel := C.gtk_tree_view_get_selection(tv) - if !fromgbool(C.gtk_tree_selection_get_selected(sel, &model, &iter)) { - return -1 - } - path := C.gtk_tree_model_get_path(model, &iter) - idx := C.gtk_tree_path_get_indices(path) - // idx is an array; simply derefernece the pointer to the first element to get the first element/only member - return int(*idx) -} - func gListboxSelectedMulti(widget *gtkWidget) (indices []int) { var model *C.GtkTreeModel diff --git a/sysdata_unix.go b/sysdata_unix.go index 8b49cad..f55e463 100644 --- a/sysdata_unix.go +++ b/sysdata_unix.go @@ -105,7 +105,6 @@ var classTypes = [nctypes]*classData{ text: gListboxText, append: gListboxAppend, insert: gListboxInsert, - selected: gListboxSelected, selMulti: gListboxSelectedMulti, smtexts: gListboxSelMultiTexts, delete: gListboxDelete,