| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="mac.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="mac.html" title='Macintosh Library Modules' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="prev" href="module-EasyDialogs.html" /> |
| 13 | <link rel="parent" href="module-EasyDialogs.html" /> |
| 14 | <link rel="next" href="module-FrameWork.html" /> |
| 15 | <meta name='aesop' content='information' /> |
| 16 | <title>2.7.1 ProgressBar Objects </title> |
| 17 | </head> |
| 18 | <body> |
| 19 | <DIV CLASS="navigation"> |
| 20 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 21 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 22 | <tr> |
| 23 | <td class='online-navigation'><a rel="prev" title="2.7 EasyDialogs " |
| 24 | href="module-EasyDialogs.html"><img src='../icons/previous.png' |
| 25 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 26 | <td class='online-navigation'><a rel="parent" title="2.7 EasyDialogs " |
| 27 | href="module-EasyDialogs.html"><img src='../icons/up.png' |
| 28 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 29 | <td class='online-navigation'><a rel="next" title="2.8 FrameWork " |
| 30 | href="module-FrameWork.html"><img src='../icons/next.png' |
| 31 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 32 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 33 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 34 | href="contents.html"><img src='../icons/contents.png' |
| 35 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 36 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 37 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 38 | <td class='online-navigation'><a rel="index" title="Index" |
| 39 | href="genindex.html"><img src='../icons/index.png' |
| 40 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 41 | </tr></table> |
| 42 | <div class='online-navigation'> |
| 43 | <b class="navlabel">Previous:</b> |
| 44 | <a class="sectref" rel="prev" href="module-EasyDialogs.html">2.7 EasyDialogs </A> |
| 45 | <b class="navlabel">Up:</b> |
| 46 | <a class="sectref" rel="parent" href="module-EasyDialogs.html">2.7 EasyDialogs </A> |
| 47 | <b class="navlabel">Next:</b> |
| 48 | <a class="sectref" rel="next" href="module-FrameWork.html">2.8 FrameWork </A> |
| 49 | </div> |
| 50 | <hr /></div> |
| 51 | </DIV> |
| 52 | <!--End of Navigation Panel--> |
| 53 | |
| 54 | <H2><A NAME="SECTION004710000000000000000"></A><A NAME="progressbar-objects"></A> |
| 55 | <BR> |
| 56 | 2.7.1 ProgressBar Objects |
| 57 | </H2> |
| 58 | |
| 59 | <P> |
| 60 | <tt class="class">ProgressBar</tt> objects provide support for modeless progress-bar |
| 61 | dialogs. Both determinate (thermometer style) and indeterminate |
| 62 | (barber-pole style) progress bars are supported. The bar will be |
| 63 | determinate if its maximum value is greater than zero; otherwise it |
| 64 | will be indeterminate. |
| 65 | |
| 66 | <span class="versionnote">Changed in version 2.2: |
| 67 | Support for indeterminate-style progress bars was |
| 68 | added.</span> |
| 69 | |
| 70 | <P> |
| 71 | The dialog is displayed immediately after creation. If the dialog's |
| 72 | ``Cancel'' button is pressed, or if <kbd>Cmd-.</kbd> or <kbd>ESC</kbd> is typed, |
| 73 | the dialog window is hidden and <tt class="exception">KeyboardInterrupt</tt> is |
| 74 | raised (but note that this response does not occur until the progress |
| 75 | bar is next updated, typically via a call to <tt class="method">inc()</tt> or |
| 76 | <tt class="method">set()</tt>). Otherwise, the bar remains visible until the |
| 77 | <tt class="class">ProgressBar</tt> object is discarded. |
| 78 | |
| 79 | <P> |
| 80 | <tt class="class">ProgressBar</tt> objects possess the following attributes and |
| 81 | methods: |
| 82 | |
| 83 | <P> |
| 84 | <dl><dt><b><tt id='l2h-91' xml:id='l2h-91' class="member">curval</tt></b></dt> |
| 85 | <dd> |
| 86 | The current value (of type integer or long integer) of the progress |
| 87 | bar. The normal access methods coerce <tt class="member">curval</tt> between |
| 88 | <code>0</code> and <tt class="member">maxval</tt>. This attribute should not be altered |
| 89 | directly. |
| 90 | </dl> |
| 91 | |
| 92 | <P> |
| 93 | <dl><dt><b><tt id='l2h-92' xml:id='l2h-92' class="member">maxval</tt></b></dt> |
| 94 | <dd> |
| 95 | The maximum value (of type integer or long integer) of the progress |
| 96 | bar; the progress bar (thermometer style) is full when <tt class="member">curval</tt> |
| 97 | equals <tt class="member">maxval</tt>. If <tt class="member">maxval</tt> is <code>0</code>, the bar will |
| 98 | be indeterminate (barber-pole). This attribute should not be altered |
| 99 | directly. |
| 100 | </dl> |
| 101 | |
| 102 | <P> |
| 103 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 104 | <td><nobr><b><tt id='l2h-93' xml:id='l2h-93' class="method">title</tt></b>(</nobr></td> |
| 105 | <td><var></var><big>[</big><var>newstr</var><big>]</big><var></var>)</td></tr></table></dt> |
| 106 | <dd> |
| 107 | Sets the text in the title bar of the progress dialog to |
| 108 | <var>newstr</var>. |
| 109 | </dl> |
| 110 | |
| 111 | <P> |
| 112 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 113 | <td><nobr><b><tt id='l2h-94' xml:id='l2h-94' class="method">label</tt></b>(</nobr></td> |
| 114 | <td><var></var><big>[</big><var>newstr</var><big>]</big><var></var>)</td></tr></table></dt> |
| 115 | <dd> |
| 116 | Sets the text in the progress box of the progress dialog to |
| 117 | <var>newstr</var>. |
| 118 | </dl> |
| 119 | |
| 120 | <P> |
| 121 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 122 | <td><nobr><b><tt id='l2h-95' xml:id='l2h-95' class="method">set</tt></b>(</nobr></td> |
| 123 | <td><var>value</var><big>[</big><var>, max</var><big>]</big><var></var>)</td></tr></table></dt> |
| 124 | <dd> |
| 125 | Sets the progress bar's <tt class="member">curval</tt> to <var>value</var>, and also |
| 126 | <tt class="member">maxval</tt> to <var>max</var> if the latter is provided. <var>value</var> |
| 127 | is first coerced between 0 and <tt class="member">maxval</tt>. The thermometer bar |
| 128 | is updated to reflect the changes, including a change from |
| 129 | indeterminate to determinate or vice versa. |
| 130 | </dl> |
| 131 | |
| 132 | <P> |
| 133 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 134 | <td><nobr><b><tt id='l2h-96' xml:id='l2h-96' class="method">inc</tt></b>(</nobr></td> |
| 135 | <td><var></var><big>[</big><var>n</var><big>]</big><var></var>)</td></tr></table></dt> |
| 136 | <dd> |
| 137 | Increments the progress bar's <tt class="member">curval</tt> by <var>n</var>, or by <code>1</code> |
| 138 | if <var>n</var> is not provided. (Note that <var>n</var> may be negative, in |
| 139 | which case the effect is a decrement.) The progress bar is updated to |
| 140 | reflect the change. If the bar is indeterminate, this causes one |
| 141 | ``spin'' of the barber pole. The resulting <tt class="member">curval</tt> is coerced |
| 142 | between 0 and <tt class="member">maxval</tt> if incrementing causes it to fall |
| 143 | outside this range. |
| 144 | </dl> |
| 145 | |
| 146 | <DIV CLASS="navigation"> |
| 147 | <div class='online-navigation'> |
| 148 | <p></p><hr /> |
| 149 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 150 | <tr> |
| 151 | <td class='online-navigation'><a rel="prev" title="2.7 EasyDialogs " |
| 152 | href="module-EasyDialogs.html"><img src='../icons/previous.png' |
| 153 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 154 | <td class='online-navigation'><a rel="parent" title="2.7 EasyDialogs " |
| 155 | href="module-EasyDialogs.html"><img src='../icons/up.png' |
| 156 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 157 | <td class='online-navigation'><a rel="next" title="2.8 FrameWork " |
| 158 | href="module-FrameWork.html"><img src='../icons/next.png' |
| 159 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 160 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 161 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 162 | href="contents.html"><img src='../icons/contents.png' |
| 163 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 164 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 165 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 166 | <td class='online-navigation'><a rel="index" title="Index" |
| 167 | href="genindex.html"><img src='../icons/index.png' |
| 168 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 169 | </tr></table> |
| 170 | <div class='online-navigation'> |
| 171 | <b class="navlabel">Previous:</b> |
| 172 | <a class="sectref" rel="prev" href="module-EasyDialogs.html">2.7 EasyDialogs </A> |
| 173 | <b class="navlabel">Up:</b> |
| 174 | <a class="sectref" rel="parent" href="module-EasyDialogs.html">2.7 EasyDialogs </A> |
| 175 | <b class="navlabel">Next:</b> |
| 176 | <a class="sectref" rel="next" href="module-FrameWork.html">2.8 FrameWork </A> |
| 177 | </div> |
| 178 | </div> |
| 179 | <hr /> |
| 180 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 181 | </DIV> |
| 182 | <!--End of Navigation Panel--> |
| 183 | <ADDRESS> |
| 184 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 185 | </ADDRESS> |
| 186 | </BODY> |
| 187 | </HTML> |