Focusing a window

Focusing a window

James Wettenhall & Philippe Grosjean bio photo By James Wettenhall & Philippe Grosjean

The following example makes window win1 the active window.

win1 <- tktoplevel() # A created windows is automatically focused

a focused Tk window

win2 <- tktoplevel() # Now the focus is on win2

a new focused Tk window

tkraise(win1)        # Reclaim the focus on win1

refocus on the first window