Re: Gtk3::TreeSelection and get_selected_rows

On Tue, 2013-02-19 at 10:31 +0000, Torsten Schoenfeld wrote:
On 19.02.2013 05:34, Dan Kasak wrote:
More Gtk2 ==> Gtk3 questions ...

When I do $tree_selection->get_selected_rows, I get an array, which
appears to have:

- row[0]: an array of Gtk3::TreePath objects
- row[1]: the model ( in my case, a Gtk3::ListStore )

Is this expected?

Yes.  Gtk2 does this differently, but I saw no compelling reason to 
uphold this inconsistency with the C API.  This particular change is 
listed in the pod: 

Ah. I had somehow not stumbled across this page yet. Thanks.

don't say anything about getting the model back.

C functions can only have one return value; to return more than one 
value, they must use "out" arguments, i.e. reference arguments that get 
set by the function.  "GtkTreeModel **model" is such an argument in this 
case.  These kinds of "out" arguments are mapped to normal return values 
by Glib::Object::Introspection (and hence by Gtk3).

Makes sense :)

Thanks for the explanation.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]