Separated GTK+ listbox index retreival and dereferencing, just to be safe/to allow easier debugging.
This commit is contained in:
parent
00abb00e8b
commit
24049d8324
|
@ -287,7 +287,8 @@ func gListboxSelected(widget *gtkWidget) int {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
path := C.gtk_tree_model_get_path(model, &iter)
|
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) {
|
func gListboxSelectedMulti(widget *gtkWidget) (indices []int) {
|
||||||
|
@ -305,7 +306,8 @@ func gListboxSelectedMulti(widget *gtkWidget) (indices []int) {
|
||||||
for i := C.guint(0); i < len; i++ {
|
for i := C.guint(0); i < len; i++ {
|
||||||
d := (*C.GtkTreeRowReference)(unsafe.Pointer(rows.data))
|
d := (*C.GtkTreeRowReference)(unsafe.Pointer(rows.data))
|
||||||
path := C.gtk_tree_row_reference_get_path(d)
|
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
|
rows = rows.next
|
||||||
}
|
}
|
||||||
return indices
|
return indices
|
||||||
|
|
Loading…
Reference in New Issue