http://www.perlmonks.org?node_id=53380


in reply to Perl/Tk Chatterbox Client

Great client!

Here's some small bits to add if you like using ^U to get rid of the text in the input widget...

Around line 541, you originally have:

$Inputfield->bind("<Return>", \&Say_Click); $Inputfield->bind("<Control-Return>", \&Msg_Click); $Inputfield->bind("<Tab>", \&completeName);
insert the ^U binding after the statements above:
$Inputfield->bind("<Control-u>", \&clearentrybox);
and around line 682, between the end of the Msg_Click sub and the beginning of the completeName sub, I put my ^U subroutine:
###################################################################### +########## # # clearentrybox # # clears the entry box on ^U # sub clearentrybox { $Inputfield->delete(0,'end'); }
So far, so good here on my system... a perusal of Tk::Text didn't reveal conflicts with normal keys...

(Update: Added context to make locating the spots to put the code a tad easier)

--
Me spell chucker work grate. Need grandma chicken.