Updated 2014-01-19 14:50:33 by dkf

Utility procedures for managing the input focus.


Synopsis edit


Description edit

tk_focusFollowsMouse changes the focus model for the application to an implicit one where the window under the mouse gets the focus. After this procedure is called, whenever the mouse enters a window Tk will automatically give it the input focus. The focus command may be used to move the focus to a window other than the one under the mouse, but as soon as the mouse moves into a new window the focus will jump to that window. Note: at present there is no built-in support for returning the application to an explicit focus model; to do this you'll have to write a script that deletes the bindings created by tk_focusFollowsMouse.

DKF: Please don't use this! The focus-follows-mouse interaction style is really quite hard to use in practice, and leads to weird bugs when the user bumps their mouse by accident. The default click/tab-to-focus style is far better from a usability perspective.

See also edit