我正在制作 GUI(登录窗口)。当密码正确时,登录窗口必须调用其他窗口。PerlTk 中有没有办法调用另一个窗口而不是使用子窗口?
use strict;
use Tk;
my $mw = MainWindow->new;
$mw->geometry("300x150");
$mw->configure(-background=>'gray',-foreground=>'red');
$mw->title("PLEASE LOGIN");
my $main_frame=$mw->Frame(
-background=>"gray",-relief=>"ridge",)->pack(-side=>'top',-fill=>'x');
my $left_frame=$main_frame->Frame(
-background=>"gray")->pack(-side=>'left',-fill=>'x');
my $bottom_frame1=$mw->Frame(
-background=>"gray")->pack(-side=>'bottom',-fill=>'x');
my $right_frame1=$mw->Frame(
-background=>"gray")->pack(-side=>'left',-fill=>'x');
my $button=$bottom_frame1->Button(-text=>"OK",-command=>\&push_button);
$button->pack(-side=>'left');
my $cancel=$bottom_frame1->Button(-text=>"CANCEL",-command=>sub{$mw->destroy});
$cancel->pack(-side=>'right');
my $entry2=$mw->Entry(-width=>20,-relief=>"ridge")->place(-x=>100,-y=>75);
sub push_button{
...
}
my $mw=MainWindow->new;
$mw->geometry("900x690");