<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--Converted with LaTeX2HTML 98.2 beta6 (August 14th, 1998)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>14. EasyDialogs --
Basic Macintosh dialogs</TITLE>
<META NAME="description" CONTENT="14. EasyDialogs --
Basic Macintosh dialogs">
<META NAME="keywords" CONTENT="mac">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="mac.css">
<LINK REL="next" HREF="module-FrameWork.html">
<LINK REL="previous" HREF="module-macspeech.html">
<LINK REL="up" HREF="contents.html">
<LINK REL="next" HREF="module-FrameWork.html">
</HEAD>
<BODY bgcolor="#ffffff">
<div class=navigation>
<table align=center width="100%" cellpadding=0 cellspacing=2>
<tr>
<td><A HREF="module-FrameWork.html"><img width=32 height=32 align=bottom border=0 alt="next"
 src="../icons/next.gif"></A></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="up"
 src="../icons/up.gif"></A></td>
<td><A HREF="speech-channel-objects.html"><img width=32 height=32 align=bottom border=0 alt="previous"
 src="../icons/previous.gif"></A></td>
<td align=center bgcolor="#99CCFF" width="100%">
 <b class=title>Macintosh Library Modules</b></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="contents"
 src="../icons/contents.gif"></A></td>
<td><a
 href="modindex.html"><img width=32 height=32 align=bottom border=0 alt="modules"
 src="../icons/modules.gif"></a></td>
<td><A HREF="genindex.html"><img width=32 height=32 align=bottom border=0 alt="index"
 src="../icons/index.gif"></A></td>
</tr></table><b class=navlabel>Next:</b> <span class=sectref><A HREF="module-FrameWork.html">15. FrameWork  </A></span>
<b class=navlabel>Up:</b> <span class=sectref><A HREF="contents.html">Contents</A></span>
<b class=navlabel>Previous:</b> <span class=sectref><A HREF="speech-channel-objects.html">13.2 Speech Channel Objects</A></span>
<br><hr></div>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION0021400000000000000000">
14. <tt class=module>EasyDialogs</tt> --
         Basic Macintosh dialogs</A>
</H1>

<P>
  
<p class=availability>Availability: <span
 class=platform>Macintosh</span>.</p>

<P>
The <tt class=module>EasyDialogs</tt> module contains some simple dialogs for
the Macintosh, modelled after the
<tt class=module>stdwin</tt><a name="l2h-220"></a> dialogs with similar names. All
routines have an optional parameter <var>id</var> with which you can
override the DLOG resource used for the dialog, as long as the item
numbers correspond. See the source for details.
 
The <tt class=module>EasyDialogs</tt> module defines the following functions:

<P>
<dl><dt><b><a name="l2h-216"><tt class=function>Message</tt></a></b> (<var>str</var>)
<dd>
A modal dialog with the message text <var>str</var>, which should be at
most 255 characters long, is displayed. Control is returned when the
user clicks ``OK''.
</dl>

<P>
<dl><dt><b><a name="l2h-217"><tt class=function>AskString</tt></a></b> (<var>prompt</var><big>[</big><var>, default</var><big>]</big>)
<dd>
Ask the user to input a string value, in a modal dialog. <var>prompt</var>
is the promt message, the optional <var>default</var> arg is the initial
value for the string. All strings can be at most 255 bytes
long. <tt class=function>AskString()</tt> returns the string entered or <tt>None</tt>in case the user cancelled.
</dl>

<P>
<dl><dt><b><a name="l2h-218"><tt class=function>AskYesNoCancel</tt></a></b> (<var>question</var><big>[</big><var>, default</var><big>]</big>)
<dd>
Present a dialog with text <var>question</var> and three buttons labelled
``yes'', ``no'' and ``cancel''. Return <tt>1</tt> for yes, <tt>0</tt> for
no and <tt>-1</tt> for cancel. The default return value chosen by
hitting return is <tt>0</tt>. This can be changed with the optional
<var>default</var> argument.
</dl>

<P>
<dl><dt><b><a name="l2h-219"><tt class=function>ProgressBar</tt></a></b> (<big>[</big><var>label</var><big>[</big><var>, maxval</var><big>]</big><big>]</big>)
<dd>
Display a modeless progress dialog with a thermometer bar. <var>label</var>
is the text string displayed (default ``Working...''), <var>maxval</var> is
the value at which progress is complete (default <tt>100</tt>). The
returned object has one method, <tt>set(<var>value</var>)</tt>, which sets
the value of the progress bar. The bar remains visible until the
object returned is discarded.

<P>
The progress bar has a ``cancel'' button, but it is currently
non-functional.
</dl>

<P>
Note that <tt class=module>EasyDialogs</tt> does not currently use the notification
manager. This means that displaying dialogs while the program is in
the background will lead to unexpected results and possibly
crashes. Also, all dialogs are modeless and hence expect to be at the
top of the stacking order. This is true when the dialogs are created,
but windows that pop-up later (like a console window) may also result
in crashes.
<p>
<div class=navigation><hr><table align=center width="100%" cellpadding=0 cellspacing=2>
<tr>
<td><A HREF="module-FrameWork.html"><img width=32 height=32 align=bottom border=0 alt="next"
 src="../icons/next.gif"></A></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="up"
 src="../icons/up.gif"></A></td>
<td><A HREF="speech-channel-objects.html"><img width=32 height=32 align=bottom border=0 alt="previous"
 src="../icons/previous.gif"></A></td>
<td align=center bgcolor="#99CCFF" width="100%">
 <b class=title>Macintosh Library Modules</b></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="contents"
 src="../icons/contents.gif"></A></td>
<td><a
 href="modindex.html"><img width=32 height=32 align=bottom border=0 alt="modules"
 src="../icons/modules.gif"></a></td>
<td><A HREF="genindex.html"><img width=32 height=32 align=bottom border=0 alt="index"
 src="../icons/index.gif"></A></td>
</tr></table><b class=navlabel>Next:</b> <span class=sectref><A HREF="module-FrameWork.html">15. FrameWork  </A></span>
<b class=navlabel>Up:</b> <span class=sectref><A HREF="contents.html">Contents</A></span>
<b class=navlabel>Previous:</b> <span class=sectref><A HREF="speech-channel-objects.html">13.2 Speech Channel Objects</A></span>
</div>
<!--End of Navigation Panel-->
<ADDRESS>
<hr>Send comments on this document to <a href="mailto:python-docs@python.org">python-docs@python.org</a>.
</ADDRESS>
</BODY>
</HTML>
