OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tk8.6.12 / doc / messageBox.n
1 '\"
2 '\" Copyright (c) 1996 Sun Microsystems, Inc.
3 '\"
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6 '\"
7 .TH tk_messageBox n 4.2 Tk "Tk Built-In Commands"
8 .so man.macros
9 .BS
10 '\" Note:  do not modify the .SH NAME line immediately below!
11 .SH NAME
12 tk_messageBox \- pops up a message window and waits for user response.
13 .SH SYNOPSIS
14 \fBtk_messageBox \fR?\fIoption value ...\fR?
15 .BE
16 .SH DESCRIPTION
17 .PP
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.
24 .PP
25 The following option-value pairs are supported:
26 .TP
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.
32 .TP
33 \fB\-default\fR \fIname\fR
34 .
35 \fIName\fR gives the symbolic name of the default button for
36 this message window (
37 .QW ok ,
38 .QW cancel ,
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.
42 .TP
43 \fB\-detail\fR \fIstring\fR
44 .
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
48 main message.
49 .TP
50 \fB\-icon\fR \fIiconImage\fR
51 .
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
55 displayed.
56 .TP
57 \fB\-message\fR \fIstring\fR
58 .
59 Specifies the message to display in this message box. The
60 default value is an empty string.
61 .TP
62 \fB\-parent\fR \fIwindow\fR
63 .
64 Makes \fIwindow\fR the logical parent of the message box. The message
65 box is displayed on top of its parent window.
66 .TP
67 \fB\-title\fR \fItitleString\fR
68 .
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.
72 .TP
73 \fB\-type\fR \fIpredefinedType\fR
74 .
75 Arranges for a predefined set of buttons to be displayed. The
76 following values are possible for \fIpredefinedType\fR:
77 .RS
78 .TP 18
79 \fBabortretryignore\fR
80 .
81 Displays three buttons whose symbolic names are \fBabort\fR,
82 \fBretry\fR and \fBignore\fR.
83 .TP 18
84 \fBok\fR
85 .
86 Displays one button whose symbolic name is \fBok\fR.
87 .TP 18
88 \fBokcancel\fR
89 .
90 Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR.
91 .TP 18
92 \fBretrycancel\fR
93 .
94 Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR.
95 .TP 18
96 \fByesno\fR
97 .
98 Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR.
99 .TP 18
100 \fByesnocancel\fR
101 .
102 Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR
103 and \fBcancel\fR.
104 .RE
105 .PP
106 .SH EXAMPLE
107 .PP
108 .CS
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 {
113     yes exit
114     no {\fBtk_messageBox\fR \-message "I know you like this application!" \e
115             \-type ok}
116 }
117 .CE
118 .SH KEYWORDS
119 message box
120 '\" Local Variables:
121 '\" mode: nroff
122 '\" End: