Re: getting window size of socket from plug...



On Sat, 2003-08-02 at 12:44, Matthew Weier OPhinney wrote:
I've got a GtkPlug setup that registers with a GtkSocket just fine. The
application that creates the socket is written in C, while my plug is in
perl (using gtk2-perl 0.90). 

What I'm wanting to do: I want to find the dimensions of the window
holding the GtkSocket so I can scale my plug to fit in it. Is this
possible? If so, how?

once the plug has been connected to the socket, $plug->get_size seems to
work to provide the info you're looking for.

i added the code:
use Data::Dumper;
Glib::Timeout->add( 500, sub { print Dumper($plug->get_size); } );

just before the Gtk2->main call in examples/plug.pl and watched the
numbers come out as i resized the window, they seemed to reflect the
size that the socket/plug was changing to.

-rm




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