Hi,
I am using a following code to create a two window..
[code=perl]
use Tk;
$ParentWindow = MainWindow->new;
$ParentWindow->geometry("300x 100");
$ParentWindow->title("Multipl e Windows Test");
$button1 = $ParentWindow->Button(-text => "Open new window",
-command => \&button1_fun c)->pack(-side => "top");
$ParentWindow->Button(-text => "Exit", -command => sub{exit})->pack();
sub button1_func {
$ChildWindow = $ParentWindow->Toplevel;
$ChildWindow->geometry("200x 150");
$ChildWindow->title("Sub Window #1");
$child_button = $ChildWindow->Button(-text => "Close window",
-command => [$ChildWindow => 'destroy'])->pack();
}
MainLoop;
[/code]
By using this code I am facing a problem, child window is not active until I click a mouse point click on a empty space..
I need the child window activate when I click the "open the window"
kindly anyone help me or provide suggestions regarding this..
Thanks,
Shan
I am using a following code to create a two window..
[code=perl]
use Tk;
$ParentWindow = MainWindow->new;
$ParentWindow->geometry("300x 100");
$ParentWindow->title("Multipl e Windows Test");
$button1 = $ParentWindow->Button(-text => "Open new window",
-command => \&button1_fun c)->pack(-side => "top");
$ParentWindow->Button(-text => "Exit", -command => sub{exit})->pack();
sub button1_func {
$ChildWindow = $ParentWindow->Toplevel;
$ChildWindow->geometry("200x 150");
$ChildWindow->title("Sub Window #1");
$child_button = $ChildWindow->Button(-text => "Close window",
-command => [$ChildWindow => 'destroy'])->pack();
}
MainLoop;
[/code]
By using this code I am facing a problem, child window is not active until I click a mouse point click on a empty space..
I need the child window activate when I click the "open the window"
kindly anyone help me or provide suggestions regarding this..
Thanks,
Shan
Comment