27. Focus, Modal Interaction, and Custom Dialogs

This chapter discusses the management of the input focus window and modal windows. Input focus determines which widget in your application receives keyboard events. A modal window is a child window that requires users to interact with it before they can continue interacting with the main window. The most common examples of modal windows are dialogs such as a file selector.

The default Tk bindings automatically handle focus management and modal interactions in a way that most users expect. For example, clicking on an entry automatically gives it focus so that the user can enter text into it, and the dialogs provided by Tk automatically behave as modal windows. Typically the only situation where ...

Get Tcl and the Tk Toolkit, Second 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.