getting the screen position of widget placed with grid screen manager

getting the screen position of widget placed with grid screen manager

Post by jack londo » Thu, 17 Aug 2006 22:28:05


Hello,

I want to put a widget1 exactly onto an WIDGET2 placed with "grid"
manager. WIDGET1 is bigger that WIDGET2 so I want to use "place"
manager to place it. To do that I need to know the screen position of
WIDGET1, but the following doesn't work

$WIDGET1->grid(-row => 12, -column => 1, -rowspan => 1, -columnspan =>
2, -sticky => 'nsew');

my $x = $WIDGET1->x;
my $y = $WIDGET1->x;

$WIDGET2->place(-x => $x, -y => $y);

the problem is that $widget->x (and ->y) always gives 0.
Is it possible to get the real screen position (absolute or relative to
parent) of a widget placed with GRID manager?

Thanks,
Davide
 
 
 

getting the screen position of widget placed with grid screen manager

Post by smallpon » Fri, 18 Aug 2006 06:09:30


I think you want gridBbox which gives you x and y relative to the
enclosing window, which is the same thing place expects for x & y.

-- S

 
 
 

getting the screen position of widget placed with grid screen manager

Post by Ala Qumsie » Sun, 20 Aug 2006 06:33:34


Try:

$WIDGET1->update;

here.


--Ala
 
 
 

getting the screen position of widget placed with grid screen manager

Post by filipp » Fri, 25 Aug 2006 03:34:28


Ala Qumsieh ha scritto:


thanks Ala, this solved my problem.