Re: this is interesting, when "running" eval

On Tue, Aug 24, 2004 at 12:00:41 -0400, Daniel Flemming wrote:
Hash: SHA1

On Tue, 24 Aug 2004, [gb2312] Lich Lee wrote:

when I eval $text;
$text is " $window->set_size_request(x, y);"
if x and y are bigger than the original size of
$window, It can execute normally, but if they are
smaller, It seem never be executed,

Nope, it's executing both times, it just doesn't do what you think it

$widget->set_size_request (x,y) says to gtk+:

 Please would you make my widget at least x pixels wide and y pixels high?

If widget is already x (or more) pixels wide and/or y (or more) pixels
high, gtk+ thinks to itself, "Oh. The program already has enough space. I
don't need to do anything." :)

There is no $widget->set_maximum_size (x,y) in gtk+.

If you want to remake a window so that it's as small as possible, this is
how I do it.

Remove the top-level widget from it first. (i.e. its HBox or VBox)
$window->set_size_request (0,0);
Re-add the top-level box back.

There is a LOT simpler way! If you
$window->set(allow_grow => 0);

Than the window *WILL* shrink to exactly it's size request!!

                                                 Jan 'Bulb' Hudec <bulb ucw cz>

Attachment: signature.asc
Description: Digital signature

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