You could try to focus the window.

$window_name->focus;

The center routine below may also be of use. It displays the window centered
on the screen. It's not mine, and I can't remember where I found it. Sorry.

Example code
---
use Tk;

$main = MainWindow->new(
        -relief => 'groove',
        -title =>  'Example',
        );

$main->withdraw; # Hide the window while you build it. Looks cleaner if you
have lots of widgets in it

&center($main); # Call once you've finished building your code.

sub center {
        my($Window) = $_[0];

        $Window->update;

        my $X_Pos = int(( $Window->screenwidth  - $Window->width )  / 2 );
        my $Y_Pos = int(( $Window->screenheight - $Window->height ) / 2 );

        $Window->geometry("+$X_Pos+$Y_Pos");
        $Window->deiconify;
        MainLoop();
}
---

That will pop up the window above all others.

John

-----Original Message-----
From: Elliott, Don (Police) [mailto:[EMAIL PROTECTED]]
Sent: 26 June 2001 16:37
To: '[EMAIL PROTECTED]'
Subject: Tk system modal window


Hi all,

I have a perl Tk program that displays a prompt line in a window.
Does anyone know how to make this line always float to the top.
 i.e. no other window should be allowed to be displayed over top of it.
 I am running on windows 2000 with activestate perl build 623

I think this mode is called system modal, but that is just a guess.

Don Elliott
Manager, Systems Management,
Saskatoon Police Service


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.


Reply via email to