Re: A couple of small bugs + patches



"Charlie Schmidt" <ishamael themes org> writes:

theyre supposed to do that.

That doesn't make a lot of sense to me. Maybe in C, it should return a
GtkWidget, but that's because C is not object-oriented, and cannot
implement inheritence at the language level.

But Perl should be returning widgets blessed into the class that the
widget really is, should it not?

For example, in Gtk, GtkBin->child is typed as a GtkWidget, but in Perl,
GtkBin->child returns an appropriately blessed object (i.e., a GtkLabel
or whatever).

If it's really supposed to do that, then instead of writing this:

  $label = $objectmenu->get_menu->get_active->child->get;

I have to write this:

  $label = bless(bless $objectmenu->get_menu, 'Gtk::Menu')->get_active,
                 'Gtk::MenuItem')->child->get;

The second option seems, convoluted, error-prone, and unnecessary.

-- 
Dave Carrigan (dave rudedog org)            | Yow! I appoint you ambassador to
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | Fantasy Island!!!
Seattle, WA, USA                            | 
http://www.rudedog.org/                     | 




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