1tk_focusNext(n) Tk Built-In Commands tk_focusNext(n)
2
3
4
5______________________________________________________________________________
6
8 tk_focusNext, tk_focusPrev, tk_focusFollowsMouse - Utility procedures
9 for managing the input focus.
10
12 tk_focusNext window
13
14 tk_focusPrev window
15
16 tk_focusFollowsMouse
17______________________________________________________________________________
18
20 tk_focusNext is a utility procedure used for keyboard traversal. It
21 returns the “next” window after window in focus order. The focus order
22 is determined by the stacking order of windows and the structure of the
23 window hierarchy. Among siblings, the focus order is the same as the
24 stacking order, with the lowest window being first. If a window has
25 children, the window is visited first, followed by its children (recur‐
26 sively), followed by its next sibling. Top-level windows other than
27 window are skipped, so that tk_focusNext never returns a window in a
28 different top-level from window.
29
30 After computing the next window, tk_focusNext examines the window's
31 -takefocus option to see whether it should be skipped. If so,
32 tk_focusNext continues on to the next window in the focus order, until
33 it eventually finds a window that will accept the focus or returns back
34 to window.
35
36 tk_focusPrev is similar to tk_focusNext except that it returns the win‐
37 dow just before window in the focus order.
38
39 tk_focusFollowsMouse changes the focus model for the application to an
40 implicit one where the window under the mouse gets the focus. After
41 this procedure is called, whenever the mouse enters a window Tk will
42 automatically give it the input focus. The focus command may be used
43 to move the focus to a window other than the one under the mouse, but
44 as soon as the mouse moves into a new window the focus will jump to
45 that window. Note: at present there is no built-in support for return‐
46 ing the application to an explicit focus model; to do this you will
47 have to write a script that deletes the bindings created by tk_focus‐
48 FollowsMouse.
49
51 focus, keyboard traversal, top-level
52
53
54
55Tk 4.0 tk_focusNext(n)