File: class-gtkprogressbar.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (69 lines) | stat: -rw-r--r-- 18,644 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.ProgressBar</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-gtkplug.html" title="gtk.Plug"><link rel="next" href="class-gtkradioaction.html" title="gtk.RadioAction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.ProgressBar</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkplug.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkradioaction.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkprogressbar"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.ProgressBar</h2><p>gtk.ProgressBar &#8212; a widget which indicates progress visually.</p></div><div class="refsect1" lang="en"><a name="id3483655"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.ProgressBar</span></span>(<span class="ooclass"><span class="classname"><a href="">gtk.Progress</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a href="class-gtkprogressbar.html#constructor-gtkprogressbar" title="Constructor">gtk.ProgressBar</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--pulse" title="gtk.ProgressBar.pulse">pulse</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--set-text" title="gtk.ProgressBar.set_text">set_text</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>text</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--set-fraction" title="gtk.ProgressBar.set_fraction">set_fraction</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>fraction</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--set-pulse-step" title="gtk.ProgressBar.set_pulse_step">set_pulse_step</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>fraction</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--set-orientation" title="gtk.ProgressBar.set_orientation">set_orientation</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>orientation</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--get-text" title="gtk.ProgressBar.get_text">get_text</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--get-fraction" title="gtk.ProgressBar.get_fraction">get_fraction</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--get-pulse-step" title="gtk.ProgressBar.get_pulse_step">get_pulse_step</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkprogressbar.html#method-gtkprogressbar--get-orientation" title="gtk.ProgressBar.get_orientation">get_orientation</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3483860"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
  +-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
    +-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
      +-- <a href="">gtk.Progress</a>
        +-- <a href="class-gtkprogressbar.html" title="gtk.ProgressBar">gtk.ProgressBar</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3483903"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"fraction"</td><td valign="top">Read-Write</td><td valign="top">The fraction of total work that has been completed</td></tr><tr valign="top"><td valign="top">"pulse-step"</td><td valign="top">Read-Write</td><td valign="top">The fraction of total progress to move the bouncing
block when pulsed</td></tr><tr valign="top"><td valign="top">"orientation"</td><td valign="top">Read-Write</td><td valign="top">The orientation and growth direction of the progress
bar: <tt class="literal">gtk.PROGRESS_LEFT_TO_RIGHT</tt>,
<tt class="literal">gtk.PROGRESS_RIGHT_TO_LEFT</tt>,
<tt class="literal">gtk.PROGRESS_BOTTOM_TO_TOP</tt>,
<tt class="literal">gtk.PROGRESS_TOP_TO_BOTTOM</tt></td></tr><tr valign="top"><td valign="top">"text"</td><td valign="top">Read-Write</td><td valign="top">The text to be displayed in the progress bar</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3484042"></a><h2>Description</h2><p>The <a href="class-gtkprogressbar.html" title="gtk.ProgressBar"><tt class="classname">gtk.ProgressBar</tt></a>
is typically used to display the progress of a long running operation. It
provides a visual clue that processing is underway. The <a href="class-gtkprogressbar.html" title="gtk.ProgressBar"><tt class="classname">gtk.ProgressBar</tt></a>
can be used in two different modes: percentage mode and activity
mode.</p><p>When an application can determine how much work needs to take
place (e.g. read a fixed number of bytes from a file) and can monitor its
progress, it can use the <a href="class-gtkprogressbar.html" title="gtk.ProgressBar"><tt class="classname">gtk.ProgressBar</tt></a>
in percentage mode and the user sees a growing bar indicating the percentage
of the work that has been completed. In this mode, the application is
required to call the <a href="class-gtkprogressbar.html#method-gtkprogressbar--set-fraction" title="gtk.ProgressBar.set_fraction"><tt class="methodname">set_fraction</tt>()</a> 
method periodically to update the progress bar.</p><p>When an application has no accurate way of knowing the amount of
work to do, it can use the <a href="class-gtkprogressbar.html" title="gtk.ProgressBar"><tt class="classname">gtk.ProgressBar</tt></a>
in activity mode, which shows activity by a block moving back and forth
within the progress area. In this mode, the application is required to call
the <a href="class-gtkprogressbar.html#method-gtkprogressbar--pulse" title="gtk.ProgressBar.pulse"><tt class="methodname">pulse</tt>()</a> 
method periodically to update the progress bar.</p><p>There is quite a bit of flexibility provided to control the
appearance of the <a href="class-gtkprogressbar.html" title="gtk.ProgressBar"><tt class="classname">gtk.ProgressBar</tt></a>. 
Methods are provided to control the orientation of the bar, optional text
can be displayed along with the bar, and the step size used in activity mode
can be set.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkprogressbar"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.ProgressBar</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkprogressbar.html" title="gtk.ProgressBar"><tt class="classname">gtk.ProgressBar</tt></a>
widget</td></tr></tbody></table><p>Creates a new <a href="class-gtkprogressbar.html" title="gtk.ProgressBar"><tt class="classname">gtk.Progressbar</tt></a>
widget.</p></div><div class="refsect1" lang="en"><a name="id3484199"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkprogressbar--pulse"></a><h3>gtk.ProgressBar.pulse</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">pulse</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">pulse</tt>() method nudges the
progressbar to indicate that some progress has been made, but you don't know
how much. This method also changes progress bar mode to "activity mode,"
where a block bounces back and forth. Each call to the <a href="class-gtkprogressbar.html#method-gtkprogressbar--pulse" title="gtk.ProgressBar.pulse"><tt class="methodname">pulse</tt>()</a> 
method causes the block to move by a little bit (the amount of movement per
pulse is determined by the <a href="class-gtkprogressbar.html#method-gtkprogressbar--set-pulse-step" title="gtk.ProgressBar.set_pulse_step"><tt class="methodname">set_pulse_step</tt>()</a> 
method).</p></div><div class="refsect2" lang="en"><a name="method-gtkprogressbar--set-text"></a><h3>gtk.ProgressBar.set_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_text</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>text</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>text</tt></b>:</span></td><td>a UTF-8 string</td></tr></tbody></table><p>The <tt class="methodname">set_text</tt>() method superimposes the
text specified by <i class="parameter"><tt>text</tt></i> on the progress bar.</p></div><div class="refsect2" lang="en"><a name="method-gtkprogressbar--set-fraction"></a><h3>gtk.ProgressBar.set_fraction</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_fraction</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>fraction</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>fraction</tt></b>:</span></td><td>the fraction of the task that's been
completed</td></tr></tbody></table><p>The <tt class="methodname">set_fraction</tt>() method causes the
progress bar to "fill in" the portion of the bar specified by
<i class="parameter"><tt>fraction</tt></i>. The value of
<i class="parameter"><tt>fraction</tt></i> should be between 0.0 and 1.0.</p></div><div class="refsect2" lang="en"><a name="method-gtkprogressbar--set-pulse-step"></a><h3>gtk.ProgressBar.set_pulse_step</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_pulse_step</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>fraction</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>fraction</tt></b>:</span></td><td>a value between 0.0 and
1.0</td></tr></tbody></table><p>The <tt class="methodname">set_pulse_step</tt>() method sets the
portion (specified by <i class="parameter"><tt>fraction</tt></i>) of the total progress
bar length to move the bouncing block for each call to the <a href="class-gtkprogressbar.html#method-gtkprogressbar--pulse" title="gtk.ProgressBar.pulse"><tt class="methodname">pulse</tt>()</a> 
method.</p></div><div class="refsect2" lang="en"><a name="method-gtkprogressbar--set-orientation"></a><h3>gtk.ProgressBar.set_orientation</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_orientation</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>orientation</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>orientation</tt></b>:</span></td><td>the orientation of the progress
bar</td></tr></tbody></table><p>The <tt class="methodname">set_orientation</tt>() method switches
the progress bar to a different orientation as specified by the value of
<i class="parameter"><tt>orientation</tt></i>. The value of
<i class="parameter"><tt>orientation</tt></i> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">gtk.PROGRESS_LEFT_TO_RIGHT</tt></span></td><td>A horizontal progress bar growing from left to
right.</td></tr><tr><td><span class="term"><tt class="literal">gtk.PROGRESS_RIGHT_TO_LEFT</tt></span></td><td>A horizontal progress bar growing from right to
left.</td></tr><tr><td><span class="term"><tt class="literal">gtk.PROGRESS_BOTTOM_TO_TOP</tt></span></td><td>A vertical progress bar growing from bottom to
top.</td></tr><tr><td><span class="term"><tt class="literal">gtk.PROGRESS_TOP_TO_BOTTOM</tt></span></td><td>A vertical progress bar growing from top to
bottom.</td></tr></tbody></table></div><div class="refsect2" lang="en"><a name="method-gtkprogressbar--get-text"></a><h3>gtk.ProgressBar.get_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_text</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the text, or
<tt class="literal">None</tt></td></tr></tbody></table><p>The <tt class="methodname">get_text</tt>() method returns the text
superimposed on the progress bar. If there is no superimposed text this
method returns <tt class="literal">None</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtkprogressbar--get-fraction"></a><h3>gtk.ProgressBar.get_fraction</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_fraction</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a fraction from 0.0 to 1.0</td></tr></tbody></table><p>The <tt class="methodname">get_fraction</tt>() method returns the
current fraction of the task that's been set by the <a href="class-gtkprogressbar.html#method-gtkprogressbar--set-fraction" title="gtk.ProgressBar.set_fraction"><tt class="methodname">set_fraction</tt>()</a> 
method .</p></div><div class="refsect2" lang="en"><a name="method-gtkprogressbar--get-pulse-step"></a><h3>gtk.ProgressBar.get_pulse_step</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_pulse_step</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a fraction from 0.0 to 1.0</td></tr></tbody></table><p>The <tt class="methodname">get_pulse_step</tt>() method returns the
pulse step set with the <a href="class-gtkprogressbar.html#method-gtkprogressbar--set-pulse-step" title="gtk.ProgressBar.set_pulse_step"><tt class="methodname">set_pulse_step</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkprogressbar--get-orientation"></a><h3>gtk.ProgressBar.get_orientation</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_orientation</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the orientation of the progress
bar</td></tr></tbody></table><p>The <tt class="methodname">get_orientation</tt>() method returns
the current progress bar orientation. See the <a href="class-gtkprogressbar.html#method-gtkprogressbar--set-orientation" title="gtk.ProgressBar.set_orientation"><tt class="methodname">set_orientation</tt>()</a>
method for information about the orientation values:
<tt class="literal">gtk.PROGRESS_LEFT_TO_RIGHT</tt>,
<tt class="literal">gtk.PROGRESS_RIGHT_TO_LEFT</tt>,
<tt class="literal">gtk.PROGRESS_BOTTOM_TO_TOP</tt>,
<tt class="literal">gtk.PROGRESS_TOP_TO_BOTTOM</tt>.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkplug.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtkradioaction.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Plug</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.RadioAction</td></tr></table></div></body></html>