Focus

The focus mechanism has been cleaned up to support different focus windows on different screens. The focus command takes a -displayof argument. Tk remembers which widget inside each toplevel has the focus. When the focus is given to a toplevel by the window manager, Tk automatically assigns focus to the right widget. The -lastfor argument queries which widget in a toplevel will get the focus by this means. Chapter 36 describes focus starting at page 518.

The focus default and focus none commands are no longer supported. There is no real need for focus default anymore, and focus none can be achieved by passing an empty string to the regular focus command.

The tk_focusFollowsMouse procedure changes from the default explicit focus model where ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.