gtk.Curve — allows direct editing of a curve.
class gtk.Curve(gtk.DrawingArea): |
|
def callback( |
gtk.Curve
is deprecated in GTK+ 2.20 and PyGTK 2.22 since it is too specialized.
The gtk.Curve
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
Gimp. The gtk.Curve
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.
def reset()
The reset
() 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.
def set_gamma(gamma
)
| the gamma value |
The set_gamma
() method recomputes the
entire curve using the value in gamma
. 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
gtk.CURVE_TYPE_FREE
.
def set_range(min_x
, max_x
, min_y
, max_y
)
| the new minimum x value |
| the maximum x value. |
| the new minimum y value |
| the maximum y value. |
The set_range
() method sets the
"min-x", "min-y", "max-x" and "max-y" properties from
min_x
, min_y
,
max_x
, and max_y
. The curve is also reset
with a call to reset
().
def get_vector(size
=-1)
| the number of points to return or -1 to return all the points in the curve. |
Returns : | a tuple containing the points |
The get_vector
() method returns a tuple
of points representing the curve. The number of points to return is
specified by size
; if size
is
-1 all the points in the curve are returned.
def set_vector(vector
)
| a list or tuple containing the points of the curve |
The set_vector
() method sets the curve
using the points in vector
. The curve type is set to
gtk.CURVE_TYPE_FREE
.
def set_curve_type(type
)
| the new curve type:
gtk.CURVE_TYPE_LINEAR ,
gtk.CURVE_TYPE_SPLINE or
gtk.CURVE_TYPE_FREE |
The set_curve_type
() method sets the
"curve-type" property with the value of type
. The
curve type must be one of gtk.CURVE_TYPE_LINEAR
,
gtk.CURVE_TYPE_SPLINE
or
gtk.CURVE_TYPE_FREE
. 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.
def callback(curve
, user_param1
, ...
)
| the curve that received the signal |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
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
set_curve_type
().
It is also changed as a side-effect of calling reset
() or
set_gamma
()