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
14
16 This procedure is part of the Tk script library. Its arguments
17 describe a dialog box:
18
19 window Name of top-level window to use for dialog. Any existing window
20 by this name is destroyed.
21
22 title Text to appear in the window manager's title bar for the dialog.
23
24 text Message to appear in the top portion of the dialog box.
25
26 bitmap If non-empty, specifies a bitmap to display in the top portion
27 of the dialog, to the left of the text. If this is an empty
28 string then no bitmap is displayed 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
56
58 tk_messageBox(n)
59
60
62 bitmap, dialog, modal
63
64
65
66Tk 4.1 tk_dialog(n)