Re: Comments about gtk, Perl/Gtk (vs Tk)

dov@Orbotech.Co.IL writes:

> * 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.

How about

  button->signal_connect ("clicked, \&func, $a, $b ,$c, $d)

I don't think a lot of attention has been paid to the "varargs"
form in Gtk:: yet, but your suggestion sounds reasonable there.


> * 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.

Toplevel windows (and nothing else) have a certain amount of
hysteresis in their resizing. This is so the user can resize
windows and have them stay that way, even when the size of
something inside changes. The details can be controlled by

  $window->set_policy (allow_shrink, allow_grow, auto_shrink)

in, particular by the auto_shrink argument. If you set that
to true, then any changes in the requisition will be reflected
in the window size.

As a general rule, you should always show a window after creating
everything inside of it. Not only will this prevent the possiblity
of strange resizing, it will give a nicer visual impression to the

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