Paw
view release on metacpan or search on metacpan
Paw/examples/app2.pl view on Meta::CPAN
}
sub m3_zurueck_cb {
$mask3_win->close_win();
$mask2_win->raise();
}
sub m3_last_entry_cb {
my $this = shift;
my $key = shift;
if ( $key eq "\t" or $key eq "\n" or $key eq KEY_DOWN ) {
$mask3_win->set_focus('m3_weiter');
}
return $key;
}
#
# reenter Maske
#
#
# callback for the reenter passwod text entry.
#
sub reenter_ok_cb {
my $re_password=$reenter_entry0->get_text(); #read the reentered password
$passwort = $m1_entry4->get_text(); #read the old password
if ( $re_password eq $passwort ) { #are they equal ?
$reenter_win->close_win(); #yes, they are equal.
$passwort_is_okay=1; #password is okay.
return;
}
else { #damn, passwords are not equal
my @buttons = ( "Ok" );
my $text = "The reentered password is not equal to your first entered password.\nPlease reenter password.";
my $pop = Paw::Popup->new( width=>35, height=>10, buttons=>\@buttons, text=>\$text );
$pop->draw();
$reenter_win->set_focus('reenter_entry');
$reenter_entry0->set_text('');
$passwort_is_okay=0;
return;
}
}
sub reenter_zurueck_cb {
$m1_entry4->set_text('');
$passwort = $m1_entry4->get_text();
$reenter_win->close_win();
}
#
# callback for the password text entry
#
sub reenter_password_cb {
my $this = shift;
my $key = shift;
my $re_password=$reenter_entry0->get_text(); #read the reentered password.
$passwort = $m1_entry4->get_text();; #read the old password
# passwod is no longer "okay" if it hs changed.
$passwort_is_okay=0 if ( not $re_password eq $passwort );
# if you are leaving the password entry and the password is not okay
# a reenter popup appears.
if ( not $passwort_is_okay and ($key eq KEY_DOWN or $key eq KEY_UP or $key eq "\t" or $key eq "\n" ) ) {
$reenter_win->raise();
}
return $key; # you must do that !
}
( run in 0.622 second using v1.01-cache-2.11-cpan-364913b4093 )