projman/hlp/en/tk/messageBox.htm
2015-10-19 14:27:31 +04:00

96 lines
4.6 KiB
HTML

<HTML><HEAD><TITLE>Tk Built-In Commands - tk_messageBox manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="messageBox.htm#M2" NAME="L806">NAME</A>
<DL><DD>tk_messageBox - pops up a message window and waits for user response.</DL>
<DD><A HREF="messageBox.htm#M3" NAME="L807">SYNOPSIS</A>
<DL>
<DD><B>tk_messageBox </B>?<I>option value ...</I>?
</DL>
<DD><A HREF="messageBox.htm#M4" NAME="L808">DESCRIPTION</A>
<DL>
<DD><A HREF="messageBox.htm#M5" NAME="L809"><B>-default</B> <I>name</I></A>
<DD><A HREF="messageBox.htm#M6" NAME="L810"><B>-icon</B> <I>iconImage</I></A>
<DD><A HREF="messageBox.htm#M7" NAME="L811"><B>-message</B> <I>string</I></A>
<DD><A HREF="messageBox.htm#M8" NAME="L812"><B>-parent</B> <I>window</I></A>
<DD><A HREF="messageBox.htm#M9" NAME="L813"><B>-title</B> <I>titleString</I></A>
<DD><A HREF="messageBox.htm#M10" NAME="L814"><B>-type</B> <I>predefinedType</I></A>
<DL>
<DD><A HREF="messageBox.htm#M11" NAME="L815"><B>abortretryignore</B></A>
<DD><A HREF="messageBox.htm#M12" NAME="L816"><B>ok</B></A>
<DD><A HREF="messageBox.htm#M13" NAME="L817"><B>okcancel</B></A>
<DD><A HREF="messageBox.htm#M14" NAME="L818"><B>retrycancel</B></A>
<DD><A HREF="messageBox.htm#M15" NAME="L819"><B>yesno</B></A>
<DD><A HREF="messageBox.htm#M16" NAME="L820"><B>yesnocancel</B></A>
</DL>
</DL>
<DD><A HREF="messageBox.htm#M17" NAME="L821">EXAMPLE</A>
<DD><A HREF="messageBox.htm#M18" NAME="L822">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
tk_messageBox - pops up a message window and waits for user response.
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_messageBox </B>?<I>option value ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This procedure creates and displays a message window with an
application-specified message, an icon and a set of buttons. Each of
the buttons in the message window is identified by a unique symbolic
name (see the <B>-type</B> options). After the message window is
popped up, <B>tk_messageBox</B> waits for the user to select one of the
buttons. Then it returns the symbolic name of the selected button.
The following option-value pairs are supported:
<P>
<DL>
<P><DT><A NAME="M5"><B>-default</B> <I>name</I></A><DD>
<I>Name</I> gives the symbolic name of the default button for
this message window ('ok', 'cancel', and so on). See <B>-type</B>
for a list of the symbolic names. If this option is not specified,
the first button in the dialog will be made the default.
<P><DT><A NAME="M6"><B>-icon</B> <I>iconImage</I></A><DD>
Specifies an icon to display. <I>IconImage</I> must be one of the
following: <B><A HREF="../TkCmd/error.htm">error</A></B>, <B><A HREF="../TkCmd/info.htm">info</A></B>, <B>question</B> or
<B>warning</B>. If this option is not specified, then the info icon will be
displayed.
<P><DT><A NAME="M7"><B>-message</B> <I>string</I></A><DD>
Specifies the message to display in this message box.
<P><DT><A NAME="M8"><B>-parent</B> <I>window</I></A><DD>
Makes <I>window</I> the logical parent of the message box. The message
box is displayed on top of its parent window.
<P><DT><A NAME="M9"><B>-title</B> <I>titleString</I></A><DD>
Specifies a string to display as the title of the message box. The
default value is an empty string.
<P><DT><A NAME="M10"><B>-type</B> <I>predefinedType</I></A><DD>
Arranges for a predefined set of buttons to be displayed. The
following values are possible for <I>predefinedType</I>:
<P>
<DL>
<P><DT><A NAME="M11"><B>abortretryignore</B></A><DD>
Displays three buttons whose symbolic names are <B>abort</B>,
<B>retry</B> and <B>ignore</B>.
<P><DT><A NAME="M12"><B>ok</B></A><DD>
Displays one button whose symbolic name is <B>ok</B>.
<P><DT><A NAME="M13"><B>okcancel</B></A><DD>
Displays two buttons whose symbolic names are <B>ok</B> and <B>cancel</B>.
<P><DT><A NAME="M14"><B>retrycancel</B></A><DD>
Displays two buttons whose symbolic names are <B>retry</B> and <B>cancel</B>.
<P><DT><A NAME="M15"><B>yesno</B></A><DD>
Displays two buttons whose symbolic names are <B>yes</B> and <B>no</B>.
<P><DT><A NAME="M16"><B>yesnocancel</B></A><DD>
Displays three buttons whose symbolic names are <B>yes</B>, <B>no</B>
and <B>cancel</B>.
<P></DL>
<P></DL>
<P>
<H3><A NAME="M17">EXAMPLE</A></H3>
<PRE>set answer [tk_messageBox -message &quot;Really quit?&quot; -type yesno -icon question]
switch -- $answer {
yes exit
no {tk_messageBox -message &quot;I know you like this application!&quot; -type ok}
}</PRE>
<H3><A NAME="M18">KEYWORDS</A></H3>
<A href="../Keywords/M.htm#message box">message box</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>