I'm trying to use Perl to provide some P4Win custom tools.
One thing I would like to do is put up a windows dialog to prompt for a
password, since we don't want our users setting P4PASSWD environment
variables.
I'm relatively new to Perl, and haven't been able to find a great way to
do this. The best I have is: (Using ActivePerl):
use Tk;
use Tk::DialogBox;
use strict;
my $main=tkinit;
makeDialog();
exit;
sub makeDialog
{
my $n_prompt=$main->DialogBox(
-title=>"Enter password",
-buttons=>["OK"]);
$n_prompt->add('Label',-text=>"Password:")->grid(-sticky=>'e',-row=>0,
-column=>0);
my $numNewGoal =
$n_prompt->add('Entry',-show=>"*")->grid(-sticky=>'ew',-row=>0,
-column=>1);
$n_prompt->Show();
my $password=$numNewGoal->get;
print ("$password\n");
}
Unfortunately, this puts up an annoying main window. I'd just like a
prompt dialog to come up, let me type in the password and have it go away.
Any ideas?
John Vriezen
vriezenj at lakeviewtech.com