Perl Tk closing windows

Posted by guy ergas on Stack Overflow See other posts from Stack Overflow or by guy ergas
Published on 2010-05-27T12:27:29Z Indexed on 2010/05/27 12:31 UTC
Read the original article Hit count: 250

Filed under:

in my perl tk script i have opened 2 windows and after a spacific button click i want to close one of them. how can i do it?

code example: main: $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; }

© Stack Overflow or respective owner

Related posts about perl