package example; use vars qw(@ISA @EXPORT @EXPORT_OK); use Exporter; @ISA = qw(Exporter); # Symbols to autoexport (:DEFAULT tag) @EXPORT = qw( ex1 ex2 %program_config ); use vars qw(%program_config); use Tk; sub ex1(){ my $mw = MainWindow->new; $mw->title("example_window1"); $mw->MainWindow->Frame( -relief=>'groove'); $mw->minsize(600,300); my $bf = $mw-> Frame( -pady => '5') ->pack( -side => 'bottom', -anchor=>'se'); my $cancel = $bf -> Button( -relief=> 'raised', -borderwidth => '2', -text => "Cancel", -command => [$mw => 'destroy']) ->pack( -side => 'right', -padx => '20'); my $next = $bf -> Button( -relief=> 'raised', -borderwidth => '2', -text => "Next", -command => sub {ex2();}, # This is where i want it to kill the window (after the #other sub has been called) # $mw => 'destroy'] ) ->pack( -side => 'right'); my $back = $bf -> Button( -relief=> 'raised', -borderwidth => '2', -text => "Back") ->pack( -side => 'right'); MainLoop; } sub ex2(){ my $mw = MainWindow->new; $mw->title("example_window2"); $mw->MainWindow->Frame( -relief=>'groove'); $mw->minsize(600,300); my $msg = $mw -> Message(-text => "Just an example")->pack(); my $bf = $mw-> Frame( -pady => '5') ->pack( -side => 'bottom', -anchor=>'se'); my $finish = $bf -> Button( -relief=> 'raised', -borderwidth => '2', -text => "Finish", -command => [$mw => 'destroy']) ->pack( -side => 'right', -padx => '20'); MainLoop; } #### my $image = $mw->Photo( -file => "saraLogo2.gif"); $mw->Label( -image => 'image1') ->pack( -side=> "left", -anchor => 'n');