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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top