$name = $bf->Entry(-textvariable => \$filename); my $button = $bf->Button( -command => \&load, -command =>[ $open => 'destroy'], -text => 'Open'); $tf->pack(-side => 'top'); $bf->pack(-side => 'bottom'); $ListBox->pack(qw/-side left -fill both -expand 1/); $name->pack(-anchor => 's'); $button->pack(-anchor => 'se'); } sub load{ my ($index) = $ListBox->curselection(); $filename = $ListBox->get($index); $mw->configure(-title => 'TextEd - ' . $filename); $InputText->Load( $filename ); (my $script = $0) =~ s,.*(\/|\\),,; }