내 Perl/Tk 스크립트에서 두 개의 창을 열었습니다. 특정 단추를 클릭 한 후 해당 단추 중 하나를 닫으려고합니다. 어떻게해야합니까? 여기에 지금까지이 작업은 다음과 같습니다Perl/Tk에서 창을 닫으려면 어떻게해야합니까?
$main = new MainWindow;
$sidebar = $main->Frame(-relief => "raised",
-borderwidth => 2)
->pack (-side=>"left" ,
-anchor => "nw",
-fill => "y");
$Button1 = $sidebar -> Button (-text=>"Open\nNetlist",
-command=> \&GUI_OPEN_NETLIST)
->pack(-fill=>"x");
MainLoop;
sub GUI_OPEN_NETLIST
{
$component_dialog = new MainWindow;
$Button = $component_dialog -> Button (-text=>"Open\nNetlist",
-command=> **close new window**)
->pack(-fill=>"x");
MainLoop;
}