summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-gtkcellrendererprogress.xml
blob: c175dfbacbb69273e88068bfe06d07849d6f47b2 (plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gtkcellrendererprogress">
  <refnamediv>
    <refname>gtk.CellRendererProgress</refname>
    <refpurpose>an object that renders numbers as progress bars in a <link
    linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
    (new in PyGTK 2.6)</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.CellRendererProgress</classname></ooclass>
      <ooclass><classname><link
linkend="class-gtkcellrenderer">gtk.CellRenderer</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gtkcellrendererprogress">gtk.CellRendererProgress</link></methodname>
	<methodparam></methodparam>
      </constructorsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkobject">gtk.Object</link>
    +-- <link linkend="class-gtkcellrenderer">gtk.CellRenderer</link>
      +-- <link linkend="class-gtkcellrendererprogress">gtk.CellRendererProgress</link>
</synopsis>

  </refsect1>

  <refsect1 id="properties-gtkcellrendererprogress">
    <title>gtk.CellRendererProgress Properties</title>

    <para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
    <para><link linkend="properties-gtkcellrenderer">gtk.CellRenderer Properties</link></para>

    <blockquote role="properties">
        <informaltable pgwide="1" frame="none">
            <tgroup cols="3">
                <colspec column="1" colwidth="1in"/>
                <colspec column="2" colwidth="1in"/>
                <colspec column="3" colwidth="3.5in"/>
                <tbody>
                    <row valign="top">
                        <entry>"orientation"</entry>
                        <entry>Read/Write</entry>
                        <entry>The "orientation" property controls the direction and growth direction
                        of the progress bar (left-to-right, right-to-left, top-to-bottom or bottom-to-top).
                        Default value: gtk.PROGRESS_LEFT_TO_RIGHT. Available in GTK+ 2.12 and above.</entry>
                    </row>
                    <row valign="top">
                        <entry>"pulse"</entry>
                        <entry>Read/Write</entry>
                        <entry>Setting this to a non-negative value causes the cell renderer to enter
                        "activity mode", where a block bounces back and forth to indicate that some progress
                        is made, without specifying exactly how much. Each increment of the property causes
                        the block to move by a little bit. To indicate that the activity has not started yet,
                        set the property to zero. To indicate completion, set the property to G_MAXINT.
                        Allowed values: >= -1. Default value: -1. Available in GTK+ 2.12 and above.</entry>
                    </row>
                    <row valign="top">
                        <entry>"text"</entry>
                        <entry>Read/Write</entry>
                        <entry>The text in the label that will be drawn over the progress bar.
                        Setting this property to <literal>None</literal> causes the default label to
                        be displayed. Setting this property to an empty string causes no label to be
                        displayed. Default value: <literal>None</literal>. Available in GTK+ 2.6 and
                        above.</entry>
                    </row>
                    <row valign="top">
                        <entry>"text-xalign"</entry>
                        <entry>Read/Write</entry>
                        <entry>The "text-xalign" property controls the horizontal alignment of the text
                        in the progress bar. Valid values range from 0 (left) to 1 (right). Reserved for
                        RTL layouts. Allowed values: [0,1]. Default value: 0.5. Available in GTK+ 2.12 and above.</entry>
                    </row>
                    <row valign="top">
                        <entry>"text-yalign"</entry>
                        <entry>Read/Write</entry>
                        <entry>The "text-yalign" property controls the vertical alignment of the text in
                        the progress bar. Valid values range from 0 (top) to 1 (bottom).
                        Allowed values: [0,1]. Default value: 0.5. Available in GTK+ 2.12 and above.</entry>
                    </row>
                    <row valign="top">
                        <entry>"value"</entry>
                        <entry>Read/Write</entry>
                        <entry>The percentage that the progress bar is "filled in".
                        Available in GTK+ 2.6 and above.</entry>
                    </row>
                </tbody>
            </tgroup>
        </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="signal-prototypes-gtkcellrendererprogress">
    <title>gtk.CellRendererProgress Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkobject">gtk.Object Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkcellrenderer">gtk.CellRenderer Signal Prototypes</link></para>
</refsect1>

  <refsect1>
    <title>Description</title>

    <note>
      <para>This object is available in PyGTK 2.6 and above.</para>
    </note>

    <para>The <link
linkend="class-gtkcellrendererprogress"><classname>gtk.CellRendererProgress</classname></link>
manages the rendering of a number as a progress bar in a <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
cell.</para>

  </refsect1>

  <refsect1 id="constructor-gtkcellrendererprogress">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.CellRendererProgress</methodname>
	<methodparam></methodparam>  </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>the new cell renderer</simpara></listitem>
      </varlistentry>
    </variablelist>

    <note>
      <para>This constructor is available in PyGTK 2.6 and above.</para>
    </note>

    <para>Creates a new <link
linkend="class-gtkcellrendererprogress"><classname>gtk.CellRendererProgress</classname></link>. 
Rendering parameters are adjusted using the object properties. The object
properties can be set globally (with <link
linkend="method-gobject--set-property"><methodname>set_property</methodname>()</link>). 
Also, with <link
linkend="class-gtktreeviewcolumn"><classname>gtk.TreeViewColumn</classname></link>, 
you can bind a property to a value in a <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>.
For example, you can bind the "text" property on the cell renderer to a
string value in the model, thus rendering a different string in each row of
the <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>.</para>

  </refsect1>

</refentry>