in reply to Re: Question on Tk Entry
in thread Question on Tk Entry

Oh, well that's something different. So, is it okay for you if the user hits the "return" key (aka "Enter") to indicate that the string in the Entry is now finished? (The user will probably have to do something to signal that their done typing.) In that case, try adding this somewhere in your code after declaring the Entry widgets:

$top->bind( 'Tk::Entry', '<Enter>', \&your_subroutine );

I suppose if you wanted the subroutine to be triggered on every keystroke, so you could see each key as it's typed, you could try:

$top->bind( 'Tk::Entry', '<KeyRelease>', [\&subroutine, Ev('K')] );

In this case, the subroutine gets the keystroke value as the second argument (first arg is the reference to the entry widget that got the event).

Replies are listed 'Best First'.
Re: Re: Re: Question on Tk Entry
by Popcorn Dave (Abbot) on Apr 22, 2002 at 04:35 UTC
    That looks a bit more like what I was after originally, but I think I'm going to stick with the button as there is no guarentee that the user would actually hit the enter key and not just move on.