Re: dinamically sized messagebox
| From: | Andrei Zmievski | Date: | Thu, 17 Oct 2002 19:07:25 +0000 |
| Subject: | Re: dinamically sized messagebox | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-2549@lists.php.net to get a copy of this message | ||
Gabor,
Try attaching to configure_event for that GtkLabel. That way you can
capture the dimensions of the widget when it resizes itself.
> I would like to put out a dinamically sized message box, with
> a GtkLabel displaying the message. The problem is that I cannot
> get the dimensions of a GtkLabel created using any given text.
>
> $label = new GtkLabel("Some text to test it's dimensions");
> var_dump($label->allocation);
>
> This prints out:
>
> object(GtkAllocation)(4) {
> ["x"]=>
> int(-1)
> ["y"]=>
> int(-1)
> ["width"]=>
> int(1)
> ["height"]=>
> int(1)
> }
>
> This is not the actual size of the object, it's sure ;) I tried
> to put the label to a container, or ->show() before calling var_dump,
> but none of these tries modified the results...
>
> Can someone please help me to open a dinamically sized messagebox?
>
> BTW GtkAllocation is not documented in the PHP-GTK docs... ;((
-Andrei http://www.gravitonic.com/
As I was going up the stair, I met a man who wasn't there.
He wasn't there again today. I wish, I wish he'd stay away.
-Hughes Mearns