Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I unset -show for Tk::Entry once set

Status
Not open for further replies.

gkmccone

Technical User
Joined
Oct 24, 2001
Messages
17
Location
US
Trying to make an Entry widget for password entry. Most of
the time a password is needed by at times it is not. I
default the Entry box to -show => '*', but when I run
across a case where a password is not needed I want to
place text in the Entry widget and disable it so it is not
editable using,

$cw->{'txtPassWd'}->configure( -state => 'normal' );
$cw->{'txtPassWd'}->delete( 0, 'end' );
$cw->{'txtPassWd'}->configure( -show => '' );
$cw->{'txtPassWd'}->insert('end', "Not Needed");
$cw->{'txtPassWd'}->configure( -state => 'disabled' );

Once this code is executed the Entry box is full of \x00s.
Can you not put normal text into the Entry widget once you have unset -show????????
 
You should have declared a textvariable for use with your text entry, why don't you just set that to what you want and display it.

my $textvar;

my $entry = $mw->Entry(-textvariable => \$textvar);
$textvar is then set to what ever you want by a decision in the program before you display it or it is set to what you want by an event such as a button press.

Hope this helps.

greadey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top