1tk_dialog(n) Tk Built-In Commands tk_dialog(n)
2
3
4
5______________________________________________________________________________
6
8 tk_dialog - Create modal dialog and wait for response
9
11 tk_dialog window title text bitmap default string string ...
12______________________________________________________________________________
13
15 This procedure is part of the Tk script library. It is largely depre‐
16 cated by the tk_messageBox. Its arguments describe a dialog box:
17
18 window Name of top-level window to use for dialog. Any existing window
19 by this name is destroyed.
20
21 title Text to appear in the window manager's title bar for the dialog.
22
23 text Message to appear in the top portion of the dialog box.
24
25 bitmap If non-empty, specifies a bitmap (in a form suitable for Tk_Get‐
26 Bitmap) to display in the top portion of the dialog, to the left
27 of the text. If this is an empty string then no bitmap is dis‐
28 played in the dialog.
29
30 default
31 If this is an integer greater than or equal to zero, then it
32 gives the index of the button that is to be the default button
33 for the dialog (0 for the leftmost button, and so on). If less
34 than zero or an empty string then there will not be any default
35 button.
36
37 string There will be one button for each of these arguments. Each
38 string specifies text to display in a button, in order from left
39 to right.
40
41 After creating a dialog box, tk_dialog waits for the user to select one
42 of the buttons either by clicking on the button with the mouse or by
43 typing return to invoke the default button (if any). Then it returns
44 the index of the selected button: 0 for the leftmost button, 1 for the
45 button next to it, and so on. If the dialog's window is destroyed
46 before the user selects one of the buttons, then -1 is returned.
47
48 While waiting for the user to respond, tk_dialog sets a local grab.
49 This prevents the user from interacting with the application in any way
50 except to invoke the dialog box.
51
53 set reply [tk_dialog .foo "The Title" "Do you want to say yes?" \
54 questhead 0 Yes No "I'm not sure"]
55
57 tk_messageBox(n)
58
60 bitmap, dialog, modal
61
62
63
64Tk 4.1 tk_dialog(n)