Bwidget Source Code
Artifact [3d1d1a51dd]
Not logged in

Artifact 3d1d1a51dd49513d9635936ad39045c01e30f0e4:


<HTML>
<HEAD><TITLE>MessageDlg</TITLE></HEAD>
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>MessageDlg</B>
 - Message dialog box
</DD></DL>
<DL>
<DT><I>CREATION</I></DT>
<DD><A HREF="#descr"><B>MessageDlg</B></A> <I>pathName</I> ?<I>option value...</I>?</DD>
</DL>
<DL>
<DT><I>STANDARD OPTIONS</I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-anchor">-anchor</A></TD>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-font">-font</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-foreground">-foreground or -fg</A></TD>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-padx">-padx</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-pady">-pady</A></TD>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="Dialog.html">OPTIONS from <B>Dialog</B></A></I></DT>
<DD><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;-background or -bg</TD>
<TD>&nbsp;&nbsp;-cancel</TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;-default</TD>
<TD>&nbsp;&nbsp;-parent</TD>
</TR>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-aspect">-aspect</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-buttons">-buttons</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-buttonwidth">-buttonwidth</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-icon">-icon</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-justify">-justify</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-message">-message</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-title">-title</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-type">-type</A></TD>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-width">-width</A></TD>
</TR>
</TR>
</TABLE></DD>
</DL>
<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>

MessageDlg provides a simple way to display a message dialog.
MessageDlg::<B>create</B> creates the message dialog, displays
it and return the index of the pressed button, or -1 if it is destroyed.
When returning, the dialog no longer exists.

</P>
<BR><HR WIDTH="50%"><BR>
<B><A NAME="wso">WIDGET-SPECIFIC OPTIONS</A></B><BR>
<DL><DT><A NAME="-aspect"><B>-aspect</B></A></DT>
<DD>

Specifies a non-negative integer value indicating desired
aspect ratio for the text.  The aspect ratio is specified as
100*width/height.  100 means the text should
be as wide as it is tall, 200 means the text should
be twice as wide as it is tall, 50 means the text should
be twice as tall as it is wide, and so on.
Used to choose line length for text if <B>width</B> option
isn't specified.
Defaults to 150.

The options <B>-width</B> and <B>-aspect</B> are directly heritated from the Tk message widget.
</DD>
</DL>
<DL><DT><A NAME="-buttons"><B>-buttons</B></A></DT>
<DD>

Specifies a list of buttons to display when <B>type</B> option is <I>user</I>.
If a button has a symbolic name, its associated text will be displayed.

</DD>
</DL>

<DL><DT><A NAME="-buttonwidth"><B>-buttonwidth</B></A></DT>
<DD>
    Specifies the standard width of the buttons in the dialog.
</DD>
</DL>

<DL><DT><A NAME="-icon"><B>-icon</B></A></DT>
<DD>

Specifies an icon to display. Must be one of the following: <B>error</B>, <B>info</B>,
<B>question</B> or <B>warning</B>.

</DD>
</DL>
<DL><DT><A NAME="-justify"><B>-justify</B></A></DT>
<DD>

Specifies how to justify lines of text.
Must be one of <B>left</B>, <B>center</B>, or <B>right</B>.  Defaults
to <B>left</B>.
This option works together with the <B>anchor</B>, <B>aspect</B>,
<B>padx</B>, <B>pady</B>, and <B>width</B> options to provide a variety
of arrangements of the text within the window.
The <B>aspect</B> and <B>width</B> options determine the amount of
screen space needed to display the text.
The <B>anchor</B>, <B>padx</B>, and <B>pady</B> options determine where this
rectangular area is displayed within the widget's window, and the
<B>justify</B> option determines how each line is displayed within that
rectangular region.
For example, suppose <B>anchor</B> is <B>e</B> and <B>justify</B> is
<B>left</B>, and that the message window is much larger than needed
for the text.
The the text will displayed so that the left edges of all the lines
line up and the right edge of the longest line is <B>padx</B> from
the right side of the window;  the entire text block will be centered
in the vertical span of the window.

</DD>
</DL>
<DL><DT><A NAME="-message"><B>-message</B></A></DT>
<DD>

Specifies the message to display in this message box.

</DD>
</DL>
<DL><DT><A NAME="-title"><B>-title</B></A></DT>
<DD>

Specifies a string to display as the title of the message box.
If the value is empty (the default), a default title will be set corresponding
to the <B>icon</B> option.
The default associated title is in english, and can be modified to set it in
another language by specifying the resource:
<PRE>    *MessageDlg.<I>name</I>Title:   <I>value</I></PRE>
or the equivalent tcl command:
<PRE>    option add *MessageDlg.<I>name</I>Title <I>value</I></PRE>
where <I>name</I> is the name of an icon as defined in the <B>icon</B> option.
<BR>For example, for french language, you can specify for a warning dialog:
<PRE>    option add *MessageDlg.warningTitle  "Attention"</PRE>

</DD>
</DL>
<DL><DT><A NAME="-type"><B>-type</B></A></DT>
<DD>

Specifies a set of buttons to be displayed. The following values are possible:
<DD>
<P>
<DL COMPACT>
<DT>
<B>abortretryignore</B>
<DD>
Displays three buttons whose symbolic names are <B>abort</B>,
<B>retry</B> and <B>ignore</B>.<P>
<DT>
<B>ok</B>
<DD>
Displays one button whose symbolic name is <B>ok</B>.<P>
<DT>
<B>okcancel</B>
<DD>
Displays two buttons whose symbolic names are <B>ok</B> and <B>cancel</B>.<P>
<DT>
<B>retrycancel</B>
<DD>
Displays two buttons whose symbolic names are <B>retry</B> and <B>cancel</B>.<P>
<DT>
<B>yesno</B>
<DD>
Displays two buttons whose symbolic names are <B>yes</B> and <B>no</B>.<P>
<DT>
<B>yesnocancel</B>
<DD>
Displays three buttons whose symbolic names are <B>yes</B>, <B>no</B>
and <B>cancel</B>.
<P>
<DT>
<B>user</B>
<DD>
Displays buttons of <B>-buttons</B> option.<P>
</DD>

<P>
For any <B>-type</B> but <B>user</B>, the native Tk widget <B>tk_messageBox</B> is used.
In this case, only the following options are considered: <B>-default</B>, <B>-icon</B>, <B>-message</B>, <B>-title</B> and <B>-type</B>.
</P>
</DL>
<DL><DT><A NAME="-width"><B>-width</B></A></DT>
<DD>

Specifies the length of lines in the window.
If this option has a value greater than zero then the <B>aspect</B>
option is ignored and the <B>width</B> option determines the line
length.
If this option has a value less than or equal to zero, then
the <B>aspect</B> option determines the line length.

</DD>
</DL>
</BODY></HTML>