in reply to help with perl/tk
The above code should make strict happy. One thing that's a pain with Tk, is that you might actually have to use globals or pay really close attention to the declaration of your variables. If this program is for you, you might just want to use globals.$login_menubutton->bind(<Mouse-1>, \&login_procedure); my $password_box; my $password_box_frame; my $password_box_entry; my $password_box_exit; sub login_procedure { if ( not ( Tk::Exists( $password_box ) ) ) { $password_box = $login->Toplevel(); $password_box_frame = $password_box->Frame()->pack(); $password_box_entry = $password_box_frame->Entry(-show); $password_box_exit = $password_box_frame->Button(-text, +'Ok', -command, \&something_with_password)->pack(-side, 'bottom'); }
|
|---|