Next: , Previous: GtkGammaCurve, Up: Top


144 GtkRuler

Base class for horizontal or vertical rulers

144.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 GTKRuler widget is a base class for horizontal and vertical rulers. Rulers are used to show the mouse pointer's location in a window. The ruler can either be horizontal or vertical on the window. Within the ruler a small triangle indicates the location of the mouse relative to the horizontal or vertical ruler. See <gtk-hruler> to learn how to create a new horizontal ruler. See <gtk-vruler> to learn how to create a new vertical ruler.

144.2 Usage

— Class: <gtk-ruler>

Derives from <gtk-widget>.

This class defines the following slots:

lower
Lower limit of ruler
upper
Upper limit of ruler
position
Position of mark on the ruler
max-size
Maximum size of the ruler
metric
The metric used for the ruler
— Function: gtk-ruler-set-metric (self <gtk-ruler>) (metric <gtk-metric-type>)
— Method: set-metric

This calls the <gtk-metric-type> to set the ruler to units defined. Available units are GTK_PIXELS, GTK_INCHES, or GTK_CENTIMETERS. The default unit of measurement is GTK_PIXELS.

ruler
the gtkruler
metric
the unit of measurement
— Function: gtk-ruler-set-range (self <gtk-ruler>) (lower double) (upper double) (position double) (max_size double)
— Method: set-range

This sets the range of the ruler using gfloat lower, gfloat upper, gfloat position, and gfloat max_size.

ruler
the gtkruler
lower
the lower limit of the ruler
upper
the upper limit of the ruler
position
the mark on the ruler
max-size
the maximum size of the ruler
— Function: gtk-ruler-get-metric (self <gtk-ruler>) ⇒  (ret <gtk-metric-type>)
— Method: get-metric

Gets the units used for a <gtk-ruler>. See gtk-ruler-set-metric.

ruler
a <gtk-ruler>
ret
the units currently used for ruler
— Function: gtk-ruler-get-range (self <gtk-ruler>) ⇒  (lower double) (upper double) (position double) (max_size double)
— Method: get-range

Retrieves values indicating the range and current position of a <gtk-ruler>. See gtk-ruler-set-range.

ruler
a <gtk-ruler>
lower
location to store lower limit of the ruler, or ‘#f
upper
location to store upper limit of the ruler, or ‘#f
position
location to store the current position of the mark on the ruler, or ‘#f
max-size
location to store the maximum size of the ruler used when calculating the space to leave for the text, or ‘#f’.