Re: Confused about Gtk2::TreeView::get_model()



Joerg Mueller said:
C API method definition for tree_model:
gboolean    gtk_tree_model_iter_nth_child   (GtkTreeModel *tree_model,
                                             GtkTreeIter *iter,
                                             GtkTreeIter *parent,
                                             gint n);

but the perl call signature for this is

  treeiter = $treemodel->iter_nth_child ($parentiter, $n)

according to the Gtk2::TreeModel manpage (generated from the stuff in cvs).
this is one reason i really want to get the doc generation stuff working
properly and make a 1.02 release.


Example code from my app:
...
my $treeview = Gtk2::TreeView->new($listStore);
my $model = $treeview->get_model;
...
print Dumper($treemodel);
...

STDOUT shows "Gtk2::TreeStore=HASH(0x8700210)" ?!?

This is wrong according to the C API definitions:
GtkTreeModel* gtk_tree_view_get_model       (GtkTreeView *tree_view);

nope, it's right: GtkTreeStore implements the GtkTreeModel interface.  in perl
that amounts to "Gtk2::TreeStore isa Gtk2::TreeModel".  a Gtk2::ListStore is
also a Gtk2::TreeModel.


Did I miss something or got it all wrong?

not wrong, just missed the subtle differences in the Glib type system's
inheritance rules and Perl's inheritance rules.

-- 
muppet <scott at asofyet dot org>



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