tk_focusNext(n)
π tk_focusNext, tk_focusPrev, tk_focusFollowsMouse β utility procedures for managing the input focus π
okay so this is the tk_focusNext(n) page, bestie β straight from the Tk Built-In Commands crew β and itβs all about input focus and how Tk moves it around. No cap, these are the utility procedures that handle the whole focus situation. π
π NAME π
tk_focusNext,tk_focusPrev,tk_focusFollowsMouseβ utility procedures for managing the input focus.
β¨ SYNOPSIS β¨
tk_focusNext window
tk_focusPrev window
tk_focusFollowsMouse
π¦ DESCRIPTION π¦
tk_focusNext is a utility procedure used for keyboard traversal. It returns the βnextβ window after window in focus order. The focus order is determined by the stacking order of windows and the structure of the window hierarchy. Among siblings, the focus order is the same as the stacking order, with the lowest window being first. If a window has children, the window is visited first, followed by its children (recursively), followed by its next sibling. Top-level windows other than window are skipped, so that tk_focusNext never returns a window in a different top-level from window. π«Ά
After computing the next window, tk_focusNext examines the windowβs -takefocus option to see whether it should be skipped. If so, tk_focusNext continues on to the next window in the focus order, until it eventually finds a window that will accept the focus or returns back to window. Itβs giving focus detective energy, fr fr. π΅οΈββοΈβ¨
tk_focusPrev is similar to tk_focusNext except that it returns the window just before window in the focus order. Same vibe, opposite direction. π«
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. mouse-powered focus, basically. ππ
β οΈ note that at present there is no built-in support for returning the application to an explicit focus model; to do this you will have to write a script that deletes the bindings created by tk_focusFollowsMouse. So yeah, if you wanna go back, youβre writing that script yourself, bestie. ππ
π KEYWORDS π
focuskeyboard traversaltop-level
okay thatβs the whole page, mwah π β signed off by Tk 4.0, filed as tk_focusNext(n), and the footer doesnβt list a date, so we are not inventing one. periodt. β¨π
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 1994 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms