<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
<link rel=
"STYLESHEET" href=
"mac.css" type='text/css'
/>
<link rel=
"SHORTCUT ICON" href=
"../icons/pyfav.png" type=
"image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index'
/>
<link rel=
"first" href=
"mac.html" title='Macintosh Library Modules'
/>
<link rel='contents' href='contents.html'
title=
"Contents" />
<link rel='index' href='genindex.html' title='Index'
/>
<link rel='last' href='about.html' title='About this document...'
/>
<link rel='help' href='about.html' title='About this document...'
/>
<link rel=
"prev" href=
"module-EasyDialogs.html" />
<link rel=
"parent" href=
"module-EasyDialogs.html" />
<link rel=
"next" href=
"module-FrameWork.html" />
<meta name='aesop' content='information'
/>
<title>2.7.1 ProgressBar Objects
</title>
<div id='top-navigation-panel' xml:id='top-navigation-panel'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"2.7 EasyDialogs "
href=
"module-EasyDialogs.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"2.7 EasyDialogs "
href=
"module-EasyDialogs.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"2.8 FrameWork "
href=
"module-FrameWork.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Macintosh Library Modules
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"module-EasyDialogs.html">2.7 EasyDialogs
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-EasyDialogs.html">2.7 EasyDialogs
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"module-FrameWork.html">2.8 FrameWork
</A>
<!--End of Navigation Panel-->
<H2><A NAME=
"SECTION004710000000000000000"></A><A NAME=
"progressbar-objects"></A>
2.7.1 ProgressBar Objects
<tt class=
"class">ProgressBar
</tt> objects provide support for modeless progress-bar
dialogs. Both determinate (thermometer style) and indeterminate
(barber-pole style) progress bars are supported. The bar will be
determinate if its maximum value is greater than zero; otherwise it
<span class=
"versionnote">Changed in version
2.2:
Support for indeterminate-style progress bars was
The dialog is displayed immediately after creation. If the dialog's
``Cancel'' button is pressed, or if
<kbd>Cmd-.
</kbd> or
<kbd>ESC
</kbd> is typed,
the dialog window is hidden and
<tt class=
"exception">KeyboardInterrupt
</tt> is
raised (but note that this response does not occur until the progress
bar is next updated, typically via a call to
<tt class=
"method">inc()
</tt> or
<tt class=
"method">set()
</tt>). Otherwise, the bar remains visible until the
<tt class=
"class">ProgressBar
</tt> object is discarded.
<tt class=
"class">ProgressBar
</tt> objects possess the following attributes and
<dl><dt><b><tt id='l2h-
91' xml:id='l2h-
91'
class=
"member">curval
</tt></b></dt>
The current value (of type integer or long integer) of the progress
bar. The normal access methods coerce
<tt class=
"member">curval
</tt> between
<code>0</code> and
<tt class=
"member">maxval
</tt>. This attribute should not be altered
<dl><dt><b><tt id='l2h-
92' xml:id='l2h-
92'
class=
"member">maxval
</tt></b></dt>
The maximum value (of type integer or long integer) of the progress
bar; the progress bar (thermometer style) is full when
<tt class=
"member">curval
</tt>
equals
<tt class=
"member">maxval
</tt>. If
<tt class=
"member">maxval
</tt> is
<code>0</code>, the bar will
be indeterminate (barber-pole). This attribute should not be altered
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
93' xml:id='l2h-
93'
class=
"method">title
</tt></b>(
</nobr></td>
<td><var></var><big>[
</big><var>newstr
</var><big>]
</big><var></var>)
</td></tr></table></dt>
Sets the text in the title bar of the progress dialog to
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
94' xml:id='l2h-
94'
class=
"method">label
</tt></b>(
</nobr></td>
<td><var></var><big>[
</big><var>newstr
</var><big>]
</big><var></var>)
</td></tr></table></dt>
Sets the text in the progress box of the progress dialog to
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
95' xml:id='l2h-
95'
class=
"method">set
</tt></b>(
</nobr></td>
<td><var>value
</var><big>[
</big><var>, max
</var><big>]
</big><var></var>)
</td></tr></table></dt>
Sets the progress bar's
<tt class=
"member">curval
</tt> to
<var>value
</var>, and also
<tt class=
"member">maxval
</tt> to
<var>max
</var> if the latter is provided.
<var>value
</var>
is first coerced between
0 and
<tt class=
"member">maxval
</tt>. The thermometer bar
is updated to reflect the changes, including a change from
indeterminate to determinate or vice versa.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
96' xml:id='l2h-
96'
class=
"method">inc
</tt></b>(
</nobr></td>
<td><var></var><big>[
</big><var>n
</var><big>]
</big><var></var>)
</td></tr></table></dt>
Increments the progress bar's
<tt class=
"member">curval
</tt> by
<var>n
</var>, or by
<code>1</code>
if
<var>n
</var> is not provided. (Note that
<var>n
</var> may be negative, in
which case the effect is a decrement.) The progress bar is updated to
reflect the change. If the bar is indeterminate, this causes one
``spin'' of the barber pole. The resulting
<tt class=
"member">curval
</tt> is coerced
between
0 and
<tt class=
"member">maxval
</tt> if incrementing causes it to fall
<div class='online-navigation'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"2.7 EasyDialogs "
href=
"module-EasyDialogs.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"2.7 EasyDialogs "
href=
"module-EasyDialogs.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"2.8 FrameWork "
href=
"module-FrameWork.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Macintosh Library Modules
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"module-EasyDialogs.html">2.7 EasyDialogs
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-EasyDialogs.html">2.7 EasyDialogs
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"module-FrameWork.html">2.8 FrameWork
</A>
<span class=
"release-info">Release
2.4.2, documentation updated on
28 September
2005.
</span>
<!--End of Navigation Panel-->
See
<i><a href=
"about.html">About this document...
</a></i> for information on suggesting changes.