Tkinter Tab Bindings
Joseph A Knapka
jknapka at earthlink.net
Tue Jan 8 22:31:57 EST 2002
Jeffrey wrote:
>
> Hi Everyone,
> I have a GUI that has several entry fields in it. Of course,
> hitting the 'TAB' or 'SHIFT-TAB' button moves the focus onto an
> adjacent field. But my problem is, that when an adjacent entry field
> ( let's say entry field "e1") has text in it and you've "tabbed" into
> the entry field "e1", all the text in entry field "e1" has been
> highlighted, thus selected. I'm trying to avoid that. I've created a
> binding, for example e0.bind( '<TAB>', foo ) and
> e2.bind('<ISO_Left_Tab>', foo ), where the function foo calls
> e1.selection_clear(), but this still doesn't help. Some other binding
> must reselect the text in "e1". Does anyone have any input.
>
> Thanks,
> Jeff
Of course I meant:
e1.bind("<FocusIn>",e1.selection_clear)
Cheers,
-- Joe
"I should like to close this book by sticking out any part of my neck
which is not yet exposed, and making a few predictions about how the
problem of quantum gravity will in the end be solved."
--- Physicist Lee Smolin, "Three Roads to Quantum Gravity"
More information about the Python-list
mailing list