2 '\" Copyright (c) 1996 Sun Microsystems, Inc.
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 .TH tk_messageBox n 4.2 Tk "Tk Built-In Commands"
10 '\" Note: do not modify the .SH NAME line immediately below!
12 tk_messageBox \- pops up a message window and waits for user response.
14 \fBtk_messageBox \fR?\fIoption value ...\fR?
18 This procedure creates and displays a message window with an
19 application-specified message, an icon and a set of buttons. Each of
20 the buttons in the message window is identified by a unique symbolic
21 name (see the \fB\-type\fR options). After the message window is
22 popped up, \fBtk_messageBox\fR waits for the user to select one of the
23 buttons. Then it returns the symbolic name of the selected button.
25 The following option-value pairs are supported:
27 \fB\-command\fR \fIstring\fR
28 Specifies the prefix of a Tcl command to invoke when the user closes the
29 dialog. The actual command consists of \fIstring\fR followed by a space
30 and the name of the button clicked by the user to close the dialog. This
31 is only available on Mac OS X.
33 \fB\-default\fR \fIname\fR
35 \fIName\fR gives the symbolic name of the default button for
39 and so on). See \fB\-type\fR
40 for a list of the symbolic names. If this option is not specified,
41 the first button in the dialog will be made the default.
43 \fB\-detail\fR \fIstring\fR
45 Specifies an auxiliary message to the main message given by the
46 \fB\-message\fR option. The message detail will be presented beneath the main
47 message and, where supported by the OS, in a less emphasized font than the
50 \fB\-icon\fR \fIiconImage\fR
52 Specifies an icon to display. \fIIconImage\fR must be one of the
53 following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or
54 \fBwarning\fR. If this option is not specified, then the info icon will be
57 \fB\-message\fR \fIstring\fR
59 Specifies the message to display in this message box. The
60 default value is an empty string.
62 \fB\-parent\fR \fIwindow\fR
64 Makes \fIwindow\fR the logical parent of the message box. The message
65 box is displayed on top of its parent window.
67 \fB\-title\fR \fItitleString\fR
69 Specifies a string to display as the title of the message box. This option
70 is ignored on Mac OS X, where platform guidelines forbid the use of a title
71 on this kind of dialog.
73 \fB\-type\fR \fIpredefinedType\fR
75 Arranges for a predefined set of buttons to be displayed. The
76 following values are possible for \fIpredefinedType\fR:
79 \fBabortretryignore\fR
81 Displays three buttons whose symbolic names are \fBabort\fR,
82 \fBretry\fR and \fBignore\fR.
86 Displays one button whose symbolic name is \fBok\fR.
90 Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR.
94 Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR.
98 Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR.
102 Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR
109 set answer [\fBtk_messageBox\fR \-message "Really quit?" \e
110 \-icon question \-type yesno \e
111 \-detail "Select \e"Yes\e" to make the application exit"]
112 switch \-\- $answer {
114 no {\fBtk_messageBox\fR \-message "I know you like this application!" \e