From 66f9e4868004792a29274952410c6a6f31d5ff6f Mon Sep 17 00:00:00 2001 From: Axel von Blomberg Date: Sat, 13 Feb 2016 17:21:29 +0100 Subject: [PATCH] Fix TreeSelection.GetSelected interface (#94) --- gtk/gtk.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gtk/gtk.go b/gtk/gtk.go index fa1b83b..ae5488d 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -8365,17 +8365,15 @@ func wrapTreeSelection(obj *glib.Object) *TreeSelection { } // GetSelected() is a wrapper around gtk_tree_selection_get_selected(). -func (v *TreeSelection) GetSelected(model *ITreeModel, iter *TreeIter) bool { - var pcmodel **C.GtkTreeModel - if model != nil { - cmodel := (*model).toTreeModel() - pcmodel = &cmodel - } else { - pcmodel = nil - } +func (v *TreeSelection) GetSelected() (model ITreeModel, iter TreeIter, ok bool) { + var cmodel *C.GtkTreeModel + var citer C.GtkTreeIter c := C.gtk_tree_selection_get_selected(v.native(), - pcmodel, iter.native()) - return gobool(c) + &cmodel, &citer) + model = wrapTreeModel(wrapObject(unsafe.Pointer(cmodel))) + iter = TreeIter{citer} + ok = gobool(c) + return } // SelectPath is a wrapper around gtk_tree_selection_select_path().