Separated GTK+ listbox index retreival and dereferencing, just to be safe/to allow easier debugging.

This commit is contained in:
Pietro Gagliardi 2014-02-17 03:10:07 -05:00
parent 00abb00e8b
commit 24049d8324
1 changed files with 4 additions and 2 deletions

View File

@ -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