Re: A couple of small bugs + patches
- From: Dave Carrigan <dave rudedog org>
- To: "Charlie Schmidt" <ishamael themes org>
- Cc: gtk-perl-list gnome org
- Subject: Re: A couple of small bugs + patches
- Date: 28 Feb 2001 20:27:00 -0800
"Charlie Schmidt" <ishamael themes org> writes:
it makes perfect sense in C, as Gtk+ has its own object system.
it returns a GtkWidget, but you can just use the macro:
GTK_MENU(widget);
to cast it as a menu.
i think that the bindings should be as accurate as possible so:
bless(bless $objectmenu->get_menu, 'Gtk::Menu');
After thinking about this for a while, I think that this is not a good
idea.
In an object-oriented system, an object should know what kind of class
it is. The programmer should never have to cast an object into its
correct class; the language should take care of that. Just because C
programmers are forced to do this doesn't make it right; it just
demonstrates that the C language does not have much support for
object-oriented design. Since gtk-perl is able to bless a Gtk object
into its real class, it should do so.
This is especially true in consideration of the fact that a Gtk::Menu
ISA Gtk::Widget, so returning a Gtk::Menu will not affect any programs
that are expecting a Gtk::Widget.
I will leave it up to Paolo, but, IMO, unnecessarily forcing Perl
programmers to bless objects into the correct class is a bad design.
--
Dave Carrigan (dave rudedog org) | Yow! Let's climb to the TOP of
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | that MOUNTAIN and think about
Seattle, WA, USA | STRIP MINING!!
http://www.rudedog.org/ |
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]