Hi Felice,


I had this same question a while ago and some very nice folks told me how
to do this:


# Get screen info for windows
$scr_width = Win32::GUI::GetSystemMetrics(0);
$scr_hgt   = Win32::GUI::GetSystemMetrics(1);

The above will get the current screen height/width, then you can center
your window as below:


$W = new GUI::Window(
      -name    => 'Window',
      -title   => 'IDU 3.0 Apply Patches',
      -left    => (($scr_width/2) - 150),
      -top     => (($scr_hgt/2) - 75),
      -width   => 300,
      -height  => 150,
      -style   => WS_OVERLAPPEDWINDOW,
      -visible => 1,
);

Hope this helps!

                -Glenn

At 07:44 AM 8/3/99 -0400, you wrote:
>Hello all,
>
>I want to center a window.    I know that to center a window you need to know
>the screen's height and width information.    Is there a function on
retrieving
>this?     I hardcoded this information in my code but I want it to be "smart"
>enough so that it will center no matter how big your screen is.
Currently I
>hardcoded the window for a 800x600 screen.
>
>Thanks,
>Felice
>
>
>
>
<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-
<->-<->

Glenn J. Christman, WD8OMW, MCSE, MCP+I    Email: [EMAIL PROTECTED]
Analysts International                     Phone: 330-796-1633
Cleveland, Ohio 


Reply via email to