File: class-gtkcurve.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 (60 lines) | stat: -rw-r--r-- 17,611 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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.Curve</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-gtkcontainer.html" title="gtk.Container"><link rel="next" href="class-gtkdialog.html" title="gtk.Dialog"></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.Curve</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkcontainer.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkdialog.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkcurve"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.Curve</h2><p>gtk.Curve &#8212; allows direct editing of a curve.</p></div><div class="refsect1" lang="en"><a name="id3399669"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Curve</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkdrawingarea.html" title="gtk.DrawingArea">gtk.DrawingArea</a></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a href="class-gtkcurve.html#constructor-gtkcurve" title="Constructor">gtk.Curve</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcurve.html#method-gtkcurve--reset" title="gtk.Curve.reset">reset</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcurve.html#method-gtkcurve--set-gamma" title="gtk.Curve.set_gamma">set_gamma</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>gamma</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcurve.html#method-gtkcurve--set-range" title="gtk.Curve.set_range">set_range</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>min_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>max_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>min_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>max_y</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcurve.html#method-gtkcurve--get-vector" title="gtk.Curve.get_vector">get_vector</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>size</tt></b></span><span class="initializer">=-1</span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcurve.html#method-gtkcurve--set-vector" title="gtk.Curve.set_vector">set_vector</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>vector</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-gtkcurve.html#method-gtkcurve--set-curve-type" title="gtk.Curve.set_curve_type">set_curve_type</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3399829"></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="class-gtkdrawingarea.html" title="gtk.DrawingArea">gtk.DrawingArea</a>
        +-- <a href="class-gtkcurve.html" title="gtk.Curve">gtk.Curve</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3399864"></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">"curve-type"</td><td valign="top">Read/Write</td><td valign="top">The curve type. One of linear
(<tt class="literal">gtk.CURVE_TYPE_LINEAR</tt>), spline interpolated
(<tt class="literal">gtk.CURVE_TYPE_SPLINE</tt>), or free-form
(<tt class="literal">gtk.CURVE_TYPE_FREE</tt>).</td></tr><tr valign="top"><td valign="top">"min-x"</td><td valign="top">Read/Write</td><td valign="top">The minimum possible value for X</td></tr><tr valign="top"><td valign="top">"max-x"</td><td valign="top">Read/Write</td><td valign="top">The maximum possible value for X</td></tr><tr valign="top"><td valign="top">"min-y"</td><td valign="top">Read/Write</td><td valign="top">The minimum possible value for Y</td></tr><tr valign="top"><td valign="top">"max-y"</td><td valign="top">Read/Write</td><td valign="top">The maximum possible value for Y</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3399994"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtkcurve.html#signal-gtkcurve--curve-type-changed" title='The "curve-type-changed" gtk.Curve Signal'>curve-type-changed</a>"</span></td><td><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>curve</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3400047"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This widget is considered too specialized or little-used for
PyGTK, and will in the future be moved to some other package. If your
application needs this widget, feel free to use it, as the widget does work
and is useful in some applications; it's just not of general interest.
However, it will eventually move out of the PyGTK distribution.</p></div><p>The <a href="class-gtkcurve.html" title="gtk.Curve"><tt class="classname">gtk.Curve</tt></a> widget
allows the user to edit a curve covering a range of values. It is typically
used to fine-tune color balances in graphics applications like the
<span class="application">Gimp</span>. The <a href="class-gtkcurve.html" title="gtk.Curve"><tt class="classname">gtk.Curve</tt></a> widget has
3 modes of operation - spline, linear and free. In spline mode the user
places points on the curve which are automatically connected together into a
smooth curve. In linear mode the user places points on the curve which are
connected by straight lines. In free mode the user can draw the points of
the curve freely, and they are not connected at all.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkcurve"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.Curve</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 gtk.Curve object</td></tr></tbody></table><p>Creates a new <a href="class-gtkcurve.html" title="gtk.Curve"><tt class="classname">gtk.Curve</tt></a>
object</p></div><div class="refsect1" lang="en"><a name="id3400138"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkcurve--reset"></a><h3>gtk.Curve.reset</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">reset</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">reset</tt>() method resets the curve to
a straight line from the minimum x and y values to the maximum x and y
values (i.e. from the bottom-left to the top-right corners). The curve type
is not changed.</p></div><div class="refsect2" lang="en"><a name="method-gtkcurve--set-gamma"></a><h3>gtk.Curve.set_gamma</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_gamma</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>gamma</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>gamma</tt></b>:</span></td><td>the gamma value</td></tr></tbody></table><p>The <tt class="methodname">set_gamma</tt>() method recomputes the
entire curve using the value in <i class="parameter"><tt>gamma</tt></i>. A gamma value
of 1 results in a straight line. Values greater than 1 result in a curve
above the straight line. Values less than 1 result in a curve below the
straight line. The curve type is changed to
<tt class="literal">gtk.CURVE_TYPE_FREE</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcurve--set-range"></a><h3>gtk.Curve.set_range</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_range</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>min_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>max_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>min_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>max_y</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>min_x</tt></b>:</span></td><td>the new minimum x value</td></tr><tr><td><span class="term"><b class="parameter"><tt>max_x</tt></b>:</span></td><td>the maximum x value.</td></tr><tr><td><span class="term"><b class="parameter"><tt>min_y</tt></b>:</span></td><td>the new minimum y value</td></tr><tr><td><span class="term"><b class="parameter"><tt>max_y</tt></b>:</span></td><td>the maximum y value.</td></tr></tbody></table><p>The <tt class="methodname">set_range</tt>() method sets the
"min-x", "min-y", "max-x" and "max-y" properties from<i class="parameter"><tt>
min_x</tt></i>, <i class="parameter"><tt>min_y</tt></i>,<i class="parameter"><tt>
max_x</tt></i>, and <i class="parameter"><tt>max_y</tt></i>. The curve is also reset
with a call to <a href="class-gtkcurve.html#method-gtkcurve--reset" title="gtk.Curve.reset"><tt class="methodname">reset</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcurve--get-vector"></a><h3>gtk.Curve.get_vector</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_vector</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>size</tt></b></span><span class="initializer">=-1</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>size</tt></b>:</span></td><td>the number of points to return or -1 to return
all the points in the curve.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a tuple containing the
points</td></tr></tbody></table><p>The <tt class="methodname">get_vector</tt>() method returns a tuple
of points representing the curve. The number of points to return is
specified by <i class="parameter"><tt>size</tt></i>; if <i class="parameter"><tt>size</tt></i> is
-1 all the points in the curve are returned.</p></div><div class="refsect2" lang="en"><a name="method-gtkcurve--set-vector"></a><h3>gtk.Curve.set_vector</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_vector</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>vector</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>vector</tt></b>:</span></td><td>a list or tuple containing the points of the
curve</td></tr></tbody></table><p>The <tt class="methodname">set_vector</tt>() method sets the curve
using the points in <i class="parameter"><tt>vector</tt></i>. The curve type is set to
<tt class="literal">gtk.CURVE_TYPE_FREE</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtkcurve--set-curve-type"></a><h3>gtk.Curve.set_curve_type</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_curve_type</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</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>type</tt></b>:</span></td><td>the new curve type:
<tt class="literal">gtk.CURVE_TYPE_LINEAR</tt>,
<tt class="literal">gtk.CURVE_TYPE_SPLINE</tt> or
<tt class="literal">gtk.CURVE_TYPE_FREE</tt></td></tr></tbody></table><p>The <tt class="methodname">set_curve_type</tt>() method sets the
"curve-type" property with the value of <i class="parameter"><tt>type</tt></i>. The
curve type must be one of <tt class="literal">gtk.CURVE_TYPE_LINEAR</tt>,
<tt class="literal">gtk.CURVE_TYPE_SPLINE</tt> or
<tt class="literal">gtk.CURVE_TYPE_FREE</tt>. The curve will remain unchanged
except when changing from a free curve to a linear or spline curve, in which
case the curve will be changed as little as possible.</p></div></div><div class="refsect1" lang="en"><a name="id3400572"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkcurve--curve-type-changed"></a><h3>The "curve-type-changed" gtk.Curve Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>curve</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></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"><i class="parameter"><tt>curve</tt></i>:</span></td><td>the curve that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "curve-type-changed" signal is emitted when the curve type
has been changed. The curve type can be changed explicitly with a call to
<a href="class-gtkcurve.html#method-gtkcurve--set-curve-type" title="gtk.Curve.set_curve_type"><tt class="methodname">set_curve_type</tt>()</a>. 
It is also changed as a side-effect of calling <a href="class-gtkcurve.html#method-gtkcurve--reset" title="gtk.Curve.reset"><tt class="methodname">reset</tt>()</a> or
<a href="class-gtkcurve.html#method-gtkcurve--set-gamma" title="gtk.Curve.set_gamma"><tt class="methodname">set_gamma</tt>()</a></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-gtkcontainer.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-gtkdialog.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Container</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.Dialog</td></tr></table></div></body></html>