Re: gtk+ 1.2.10, Gtk-Perl 0.7008 -- how the heck do I set initial window position?



 From: muppet <scott asofyet org>
 Date: 28 Jan 2003 23:50:31 -0500
 
 be that as it may, i just tried 
 
   ...
   $window->show_all;
   $window->window->move ( 252, 35 );
   ...
   Gtk->main;
 
 and it worked.

It is not surprising that that may work some of the time, or even most
of the time.  But occasionally it won't.

 it may be that your window is really complicated, and it takes a long
 time between the show and move so that there is flicker,

Twm is anything but "really complicated."

Any method which depends on other processes performing tasks quickly
is by definition a race condition and therefore not a correct answer.

In any case, I think I've come up with something that works reliably,
although I won't know for certain until the first time I see it fail
:-).

I'm hiding the window before realizing it, then repositioning it, then
showing it.  That is....

$window->set_usize($width, $height);
$window->hide;
$window->realize;
$window->set_uposition($x, $y);
$window->show_all;

This appears to work, at least so far.

  jik



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