Bringing a window to foreground.

R

rajendra

Hello All,
Please find my small script.

use Tk;
$main=MainWindow->new;
$main->Button(-text => "Click",-command => \&disp)->pack(-side =>'left');
$text1=$main->Text(-width => 40 ,-height => 2)->pack;
$text1->bind('<Enter>',\&disp);

$main->after(500,sub{$main->attributes(-topmost=> 1)});
# this works on windows

MainLoop;

sub disp
{
$text1->insert('end',"Hello");
}

What should I add for this script to bring the window that gets generated
by
this script to foreground even if I change my focus?..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top