Whoops, the GList returned by gtk_tree_selection_get_selected_rows contains GtkTreePaths, not GtkTreeRowReferences. Fixed the index getting.
This commit is contained in:
parent
24049d8324
commit
e395ea105b
|
@ -304,8 +304,7 @@ func gListboxSelectedMulti(widget *gtkWidget) (indices []int) {
|
||||||
}
|
}
|
||||||
indices = make([]int, len)
|
indices = make([]int, len)
|
||||||
for i := C.guint(0); i < len; i++ {
|
for i := C.guint(0); i < len; i++ {
|
||||||
d := (*C.GtkTreeRowReference)(unsafe.Pointer(rows.data))
|
path := (*C.GtkTreePath)(unsafe.Pointer(rows.data))
|
||||||
path := C.gtk_tree_row_reference_get_path(d)
|
|
||||||
idx := C.gtk_tree_path_get_indices(path)
|
idx := C.gtk_tree_path_get_indices(path)
|
||||||
indices[i] = int(*idx)
|
indices[i] = int(*idx)
|
||||||
rows = rows.next
|
rows = rows.next
|
||||||
|
@ -328,8 +327,7 @@ func gListboxSelMultiTexts(widget *gtkWidget) (texts []string) {
|
||||||
}
|
}
|
||||||
texts = make([]string, len)
|
texts = make([]string, len)
|
||||||
for i := C.guint(0); i < len; i++ {
|
for i := C.guint(0); i < len; i++ {
|
||||||
d := (*C.GtkTreeRowReference)(unsafe.Pointer(rows.data))
|
path := (*C.GtkTreePath)(unsafe.Pointer(rows.data))
|
||||||
path := C.gtk_tree_row_reference_get_path(d)
|
|
||||||
if !fromgbool(C.gtk_tree_model_get_iter(model, &iter, path)) {
|
if !fromgbool(C.gtk_tree_model_get_iter(model, &iter, path)) {
|
||||||
// TODO
|
// TODO
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue