Comments about gtk, Perl/Gtk (vs Tk)
- From: dov Orbotech Co IL
- To: gtk-list redhat com
- CC: kjahds kjahds com
- Subject: Comments about gtk, Perl/Gtk (vs Tk)
- Date: Wed, 15 Apr 1998 09:06:36 +0300 (IDT)
- Date: Wed, 15 Apr 98 09:06:37 IDT
(If you have seen this posting twice, I appologize, but it didn't
appear in the gtk-list archives, so I'm resending it.)
Hello,
I finally got around to testing the new Perl/Gtk module. I have
quite a lot of experience with Perl/Tk, and below are some
of my impressions as how they compare.
* I found the syntax of the Gtk named parameters much noiser and
verbose than necessary. Why use
GtkWindow::title => "hello world",
when a simple
-title => "hello world"
would do just as well? I'm sure that the number of ambigious cases
is very small.
* The callback parameter (signal::clicked) should not only take code
references, but also array references, where the first element in
the array indicates the function to call, and the rest of the
parameters are passed to the function when it is called in the
callback. That's the way it's done in Tk.
* In Tk a parent creates it's children. In syntax for the same
operation in Gtk is much noiser. Compare
Gtk::Widget->new("GtkButton",
GtkWidget::parent => $window,
)
to:
$window->Button()
* A gtk comment, which might be due to my limited understanding of
gtk: I don't like the fact that the order of showing the widgets
changes the size in which they are displayed. Why don't the
containers automatically adjust themself to contain their children?
E.g. there is a big difference in the "simple" program if
$window->show() is executed before the GtkButton is added to it.
* I couldn't get gdk_imlib work from within Gtk. I don't know what
went wrong, but whatever I did, I always get:
Can't locate object method "init" via package "Gtk::Gdk::ImlibImage"
at gdkimlib.pl line 5.
This happened, even though extension.xsh contains:
BOOT:
{
callXS (boot_Gtk__Gdk__ImlibImage, cv, mark);
}
And the compilation seems to have been ok.
The use of gdk_imlib is really the major cause of my interest in
Gtk at the moment. I would like to create a new widget class that
I call a Zoomvas that allows automatic zooming with callbacks
for drawing what is actually zoomed.
But alltogether I'm very impressed with gtk and Gtk, and I am sure I
will be using them a lot in the years to come. Thanks a lot!
Regards,
--
___
Dov Grobgeld | Email: dov@orbotech.co.il /+ \ PCB
Algorithms Department, Orbotech | Phone: +972-8-9423882 \ +/ AOI
Yavne 70651, Israel | Fax: +972-8-9423775 __| |
Disclaimer: All views above are mine alone. ____|
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]