I am using a following code to create a two window..
Expand|Select|Wrap|Line Numbers
- use Tk;
- $ParentWindow = MainWindow->new;
- $ParentWindow->geometry("300x100");
- $ParentWindow->title("Multiple Windows Test");
- $button1 = $ParentWindow->Button(-text => "Open new window",
- -command => \&button1_func)->pack(-side => "top");
- $ParentWindow->Button(-text => "Exit", -command => sub{exit})->pack();
- sub button1_func {
- $ChildWindow = $ParentWindow->Toplevel;
- $ChildWindow->geometry("200x150");
- $ChildWindow->title("Sub Window #1");
- $child_button = $ChildWindow->Button(-text => "Close window",
- -command => [$ChildWindow => 'destroy'])->pack();
- }
- MainLoop;
I need the child window activate when I click the "open the window"
kindly anyone help me or provide suggestions regarding this..
Thanks,
Shan