[Tkinter-discuss] OptionMenu Cannot Receive Keyboard Focus?

Michael Lange klappnase at web.de
Wed May 26 20:34:32 CEST 2010


Hi,

On Wed, 26 May 2010 12:06:33 -0500
"Lowe, Paul J (AS)" <paul.lowe at ngc.com> wrote:

> Hi,
> 
> I've made a Tkinter gui composed of labels, entries, and optionmenus.
> 
> When I enter data on the keyboard and use the tab key to switch to the
> next widget in the GUI, it always skips the OptionMenus entirely. For
> example, if I have a GUI composed of an entry, an optionmenu, and
> another entry, in that order, if I type text in the first entry, then
> hit the tab key, the cursor will go straight to the other text entry -
> skipping the optionmenu entirely.
> 
> Has anyone else observed this phenomenon? Is there a workaround? Is
> it a formally documented bug?
> 

I think the OptionMenu's takefocus option is set to false by default,
so a simple

    your_option_menu.configure(takefocus=1)

should do the trick.

I hope this helps

Michael

 


More information about the Tkinter-discuss mailing list