[6] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

Gtk/Perl syntax

daemon@ATHENA.MIT.EDU (Owen Taylor)
Fri May 2 00:41:08 1997

To: gtk-list@redhat.com
From: Owen Taylor <owt1@cornell.edu>
Date: 02 May 1997 00:41:27 -0400
In-Reply-To: Shawn T Amundson's message of Thu, 1 May 1997 22:16:24 -0500 (CDT)
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com


Shawn T Amundson <amundson@cs.umn.edu> writes:

> Personally, I prefer the following for perl.  Also, PerlTk is an awesome 
> example of how to use the OO features of perl to their fullest.

Perl/Tk was certainly an inspiration for the way I set things up.
Though I'd like to keep things simpler - Perl/Tk has gotten better
but it still does a whole bunch of of hash thrashing at startup.

IMHO, my Gtk bindings are at least as OO as Perl/Tk. (Though maybe
not as clever.)

I'm ambivalent about exporting - the only thing you gain is one character
(gtk_init instead of Gtk::init). It would allow making Gtk not a
toplevel module though ...

> # The next includes the "add" right along with the 
> # with, defining the parent right away, making use of
> # the OO design a bit more. (This causes significant
> # decrease in code.) 
> $button = $window->button_with_label("Hello World");

This really doesn't make sense in the context of gtk - parenting
is a much more flexible thing in gtk than in Tk. In gtk the
only heirarchy the user sees is that of containment - unlike Tk
where there are two non-identical heirarchies - that of
containment/packing and that of ancestry.

Since containment can be expressed in many ways, (item in a list,
widget in a table, widget in a box, etc...), I think it needs
a separate command from creation - which is no worse than Tk
where you have to pack things afterwards.

Thanks for the comments,
                                        Owen

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post