Re: Getting window size (correctly)



On Fri, 2002-05-10 at 07:07, bcorr wrote:
I am having trouble with getting the window size using the following code:

$widgets->{'ephemeral'}->show_all();
my @args = $widgets->{'ephemeral'}->window->get_geometry();
print join " ", @args, "\n";

Where 'ephemeral' is a Window containing a ScrolledWindow containing a Text
widget.


When this is run I get the following reported :

0 0 200 200 8

200 x 200, being the width and height. Unfortunately this is wrong. 

I added a callback to report the same data if I press a key in the window,
this gives me the correct dimensions (i.e the ones I set using 'usize').

I have tried doing a main_iteration while events_pending type wait just in
case something was out od sync, but it still makes no difference.

I have also tried ->get_toplevel->window->get_geometry(); and get_size();

Anyone got any ideas?

Cheers,

Bill.

PS I am using Gtk Perl 0.7008 on CDE/Solaris. 

Try 

my ($width, $height) = ($widgets->{'ephemeral'}->allocation())[2,3];

instead.

-- 
Today is Setting Orange the 57th day of Discord in the YOLD 3168
Frink!

Missile Address: 33:48:3.521N  84:23:34.786W




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