Next: , Previous: GtkSocket, Up: Top


142 GtkCurve

Allows direct editing of a curve

142.1 Overview

This widget is considered too specialized/little-used for GTK+, 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, we are not accepting new features for the widget, and it will eventually move out of the GTK+ distribution.

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.

142.2 Usage

— Class: <gtk-curve>

Derives from <gtk-drawing-area>.

This class defines the following slots:

curve-type
Is this curve linear, spline interpolated, or free-form
min-x
Minimum possible value for X
max-x
Maximum possible X value
min-y
Minimum possible value for Y
max-y
Maximum possible value for Y
— Signal on <gtk-curve>: curve-type-changed

Emitted when the curve type has been changed. The curve type can be changed explicitly with a call to gtk-curve-set-curve-type. It is also changed as a side-effect of calling gtk-curve-reset or gtk-curve-set-gamma.

— Function: gtk-curve-new ⇒  (ret <gtk-widget>)

Creates a new <gtk-curve>.

ret
a new <gtk-curve>.
— Function: gtk-curve-reset (self <gtk-curve>)
— Method: reset

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.

curve
a <gtk-curve>.
— Function: gtk-curve-set-gamma (self <gtk-curve>) (gamma float)
— Method: set-gamma

Recomputes the entire curve using the given gamma value. 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’. FIXME: Needs a more precise definition of gamma.

curve
a <gtk-curve>.
gamma
the gamma value.
— Function: gtk-curve-set-range (self <gtk-curve>) (min_x float) (max_x float) (min_y float) (max_y float)
— Method: set-range

Sets the minimum and maximum x and y values of the curve. The curve is also reset with a call to gtk-curve-reset.

curve
a <gtk-curve>.
min-x
the minimum x value.
max-x
the maximum x value.
min-y
the minimum y value.
max-y
the maximum y value.