stk/Help/message-box.n.html

80 lines
3.3 KiB
HTML
Raw Normal View History

1998-09-30 07:11:02 -04:00
<HTML><HEAD><TITLE>STk procedure - Tk:message-box manual page</TITLE></HEAD>
<BR>
<BODY bgcolor = #c3ffc3>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageGreen.gif"> Tk:message-box</H2>
<I>pops up a message window and waits for user response.</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
<B>(Tk:message-box </B>?<I>option value ...</I>?)<BR>
<H3><A NAME="M3">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:message-box</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>
<DT><A NAME="M4"><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 the message box has just one
button it will automatically be made the default, otherwise if this
option is not specified, there won't be any default button.
<P>
<DT><A NAME="M5"><B>:icon</B> <I>iconImage</I></A><DD>
Specifies an icon to display. <I>IconImage</I> must be one of the
following: <B>error</B>, <B>info</B>, <B>question</B> or
<B>warning</B>. If this option is not specified, then no icon will be
displayed.
<P>
<DT><A NAME="M6"><B>:message</B> <I>string</I></A><DD>
Specifies the message to display in this message box.
<B>:title</B> <I>titleString</I>
Specifies a string to display as the title of the message box. The
default value is an empty string.
<P>
<DT><A NAME="M7"><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>
<P>
<DL>
<DT><A NAME="M8"><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="M9"><B>Ok</B></A><DD>
Displays one button whose symbolic name is <B>ok</B>.
<P>
<DT><A NAME="M10"><B>OkCancel</B></A><DD>
Displays two buttons whose symbolic names are <B>ok</B> and <B>cancel</B>.
<P>
<DT><A NAME="M11"><B>RetryCancel</B></A><DD>
Displays two buttons whose symbolic names are <B>retry</B> and <B>cancel</B>.
<P>
<DT><A NAME="M12"><B>YesNo</B></A><DD>
Displays two buttons whose symbolic names are <B>yes</B> and <B>no</B>.
<P>
<DT><A NAME="M13"><B>YesNoCancel</B></A><DD>
Displays three buttons whose symbolic names are <B>yes</B>, <B>no</B>
and <B>cancel</B>.
<P>
</DL>
</DL>
<P>
<H3><A NAME="M14">EXAMPLE</A></H3>
<PRE>(let ((answer (Tk:message-box :message &quot;Really quit?&quot;
:type 'YesNo
:icon 'question)))
(case answer
((yes) (exit))
(else (Tk:message-box :message &quot;I know you like this application!&quot;
:type 'Ok))))</PRE>
<H3><A NAME="M15">SEE ALSO</A></H3>
<B><A HREF="./make-dialog.n.html">make-dialog</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif"><P>
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookGreen.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>