[Tkinter-discuss] Switching between Entry widgets

Jay Taneja jay.taneja at gmail.com
Thu Jul 21 06:10:17 CEST 2005

hi everyone - i'm relatively new to python/tkinter, so it may be
something pretty silly i've overlooked.

the tkinter application i have written has two entry widgets and two
buttons. what i would like is for the focus to be on the first entry
widget, such that i launch the program and can immediately input text
into the entry box. for some reason, i am unable to get the focus()
command working for me.

additionally, the input device i am using to put text in the entry
boxes ends in a carriage return. as soon as this carriage return is
received in the first entry box, i would like the focus to go to the
second entry box. when the second entry box gets a carriage return, i
would like to issue the callback of the first button widget.

this all seems to make sense in my head, binding the <Return> keypress
to switch the focus, but i can't seem to get everything working
correctly. the program doesn't respond to my bindings and i can't get
the focus switching to work at all.

any help would be greatly appreciated. thank you.


More information about the Tkinter-discuss mailing list