in reply to How to printout a Gtk2::ComboBox
I suspect the python bindings have some overloading when used as an iterable.
In the perl bindings you get the treemodel object and then iterate over it using the iter_next or foreach methods.
See http://gtk2-perl.sourceforge.net/doc/pod/Gtk2/TreeModel.html#_model_foreach_func_ and http://gtk2-perl.sourceforge.net/doc/pod/Gtk2/TreeModel.html#treeiter_tree_model_4
Maybe something like this will work (untested).
my $callback = sub { my ($model, $path, $iter) = @_; my @selected = $model->get($iter); print @selected; # return false to ensure we keep iterating return; } my $model = $combo->get_model; $model->foreach ($callback);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to printout a Gtk2::ComboBox
by swl (Prior) on Aug 16, 2019 at 22:59 UTC |