in reply to Clearing an entry-box in TK

Hi, you don't need the Enter button bar to enter the data. Use
my $input = $mw->Entry (-text => "",)->form; $input->focus; $input->bind('<Return>', \&enter);
that will put the cursor right into the entry widget, so the player can start typing numbers, followed by the Enter key to play the number.

To clear the last number out, put this at the end of your sub enter:

sub enter{ ...... ..... $input->delete(0,'end'); }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^2: Clearing and entry-box in TK
by Panda (Scribe) on Sep 24, 2006 at 01:53 UTC
    Thanks zentara, I've tried using that in my code and it works perfectly.