Chapter 36. Focus, Grabs, and Dialogs

Dialog boxes are a standard part of any user interface. Several dialog boxes are built into Tk. This chapter also describes how to build dialogs from scratch, which involves keyboard focus and grabs. Input focus directs keyboard events to different widgets. The grab mechanism lets a widget capture the input focus. This chapter describes the focus, grab, tk_dialog, and tkwait commands. Tk 4.2 adds tk_getOpenFile, tk_getSaveFile, tk_chooseColor, and tk_messageBox.

Dialog boxes are a common feature in a user interface. The application needs some user response before it can continue. A dialog box displays some information and some controls, and the user must interact with it before the application can continue. ...

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.