[EMAIL PROTECTED] wrote:

Guys,

When I start my script the following happens...

The main window appears in a random location, smaller than when fully
populated.
It resizes to accomodate all it's widgets.
It jumps to the centre of the screen.

I want it to appear complete in the centre of the screen with no jumping
about.

I tried this...

my $main_window = MainWindow -> new (options);
$main_window->withdraw;

...fill the main_window...

# POSITION MAIN WINDOW IN CENTRE OF SCREEN
my $screenwidth = $main_window -> screenwidth;
my $screenheight = $main_window -> screenheight;
my $xposition = int (( $screenwidth - $windowwidth ) / 2);
my $yposition = int (( $screenheight - $windowheight ) / 2);

$main_window -> geometry ("+$xposition+$yposition");
$main_window -> deiconify;
$main_window -> raise;

MainLoop();

But, of course, because the main_window is not shown on the screen, I can't
get the windiwwidth and windowheight of it...

Global symbol "$windowwidth" requires explicit package name...
Global symbol "$windowheight" requires explicit package name...

Is there a way of doing what I'm trying to do, without drawing the window,
then moving it?

Richard --


#...fill the main_window...
$main_window->update;

my $windowwidth = $main_window ->width;
my $windowheight = $main_window ->height;

Should do it, I think.

-- mike higgins

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to