From 24049d8324fb62b72e164f575e9c9c9d378bfbfe Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 17 Feb 2014 03:10:07 -0500 Subject: [PATCH] Separated GTK+ listbox index retreival and dereferencing, just to be safe/to allow easier debugging. --- gtkcalls_unix.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtkcalls_unix.go b/gtkcalls_unix.go index 40f61cd..0394e39 100644 --- a/gtkcalls_unix.go +++ b/gtkcalls_unix.go @@ -287,7 +287,8 @@ func gListboxSelected(widget *gtkWidget) int { return -1 } path := C.gtk_tree_model_get_path(model, &iter) - return int(*C.gtk_tree_path_get_indices(path)) + idx := C.gtk_tree_path_get_indices(path) + return int(*idx) } func gListboxSelectedMulti(widget *gtkWidget) (indices []int) { @@ -305,7 +306,8 @@ func gListboxSelectedMulti(widget *gtkWidget) (indices []int) { for i := C.guint(0); i < len; i++ { d := (*C.GtkTreeRowReference)(unsafe.Pointer(rows.data)) path := C.gtk_tree_row_reference_get_path(d) - indices[i] = int(*C.gtk_tree_path_get_indices(path)) + idx := C.gtk_tree_path_get_indices(path) + indices[i] = int(*idx) rows = rows.next } return indices