in reply to Drop-In Password Dialog?
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = new MainWindow(); my $password = ''; my $entry = $mw->Entry( -show=>'*', -relief=>'ridge', -textvariable=>\$password )->pack; $entry->bind('<Return>',[\&somesub]); $entry->focus; # when the MainLoop is destroyed, the calling script can continue MainLoop; sub somesub { $password = $entry->get; print "password ->$password\n"; $mw->destroy; } print "you can continue on here\n"; <>; #wait for keypress to exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Drop-In Password Dialog?
by ColonelPanic (Friar) on Nov 29, 2012 at 06:32 UTC | |
|
Re^2: Drop-In Password Dialog?
by ColonelPanic (Friar) on Dec 03, 2012 at 15:07 UTC |