tk_dialog(n)
π NAME π
tk_dialog(n) β okay bestie, this is the Tk Built-In Commands page for tk_dialog, and the official vibe is: Create modal dialog and wait for response. π
β¨ SYNOPSIS β¨
tk_dialog window title text bitmap default string string ...
π DESCRIPTION π
This procedure is part of the Tk script library. It is largely deprecated by tk_messageBox β that's the official caveat, bestie, so take it as the deprecation vibe check. π Its arguments describe a dialog box:
windowβ name of the top-level window to use for the dialog. Any existing window by this name is destroyed β yep, gone, periodt.titleβ text that appears in the window manager's title bar for the dialog.textβ the message that appears in the top portion of the dialog box.bitmapβ if non-empty, this specifies a bitmap (in a form suitable forTk_GetBitmap) to display in the top portion of the dialog, to the left of the text. If it's an empty string, then no bitmap is displayed in the dialog.defaultβ if this is an integer greater than or equal to zero, it gives the index of the button that is the default button for the dialog (0for the leftmost button, and so on). If it's negative or an empty string, then there will not be any default button.stringβ there will be one button for each of these arguments. Eachstringspecifies text to display in a button, in order from left to right.
After creating a dialog box, tk_dialog waits for the user to select one of the buttons either by clicking on the button with the mouse or by typing return to invoke the default button (if any). Then it returns the index of the selected button: 0 for the leftmost button, 1 for the button next to it, and so on. If the dialog's window is destroyed before the user selects one of the buttons, then -1 is returned.
While waiting for the user to respond, tk_dialog sets a local grab. This prevents the user from interacting with the application in any way except to invoke the dialog box. π«Ά
π§ EXAMPLE π§
set reply [tk_dialog .foo "The Title" "Do you want to say yes?" \
questhead 0 Yes No "I'm not sure"]
π¦ SEE ALSO π¦
π KEYWORDS π
bitmap, dialog, modal
Footer energy, bestie: this is from Tk version 4.1, manual page tk_dialog(n). The original didn't print a date, so I'm not inventing one β no fake facts on my watch πβ¨
π¦ 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) 1992 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