On Fri, Jul 23, 2010 at 04:05, Mike Martin <m...@redtux.org.uk> wrote: > Does such a thing exist in Gtk? eg: if I do something like > > foreach my $widget ($vbox->get_children){ > print $widget > } > It will fail if there are any widgets that dont have children such as > a label or a GTkEntry
Do you in fact ask how to determine if an object has a method called "get_children"? Then the answer is "can". if ($vbox->can('get_children') { for my $widget ($vbox->get_children) { ... } } > I've googled and searched API docs but cant see anything Not Gtk, just Perl's OOP. _______________________________________________ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list