gtk.Ruler
gtk.Ruler — a base class for horizontal or vertical rulers
Description
Note
This widget is considered too specialized or little-used for
PyGTK and 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, it will eventually move out of the PyGTK and GTK+
distribution.
The gtk.Ruler widget is a
base class for horizontal and vertical rulers. Rulers are used to show the
mouse pointer's location in a 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
about horizontal rulers. See gtk.VRuler to learn
about vertical rulers.
Methods
gtk.Ruler.set_metric
metric : | the measurement units |
The set_metric() method sets the
measurement units of the ruler to the value specified by
metric. Available units are
gtk.PIXELS, gtk.INCHES, or
gtk.CENTIMETERS. The default unit of measurement is
gtk.PIXELS.
gtk.Ruler.set_range
def set_range(lower, upper, position, max_size)
|
lower : | the upper limit of the ruler |
upper : | the lower limit of the ruler |
position : | the position of the mark on the ruler |
max_size : | the maximum size of the rule |
The set_range() method sets the range
of the ruler to the values specified by lower,
upper, position and
max_size (all values are floats).
gtk.Ruler.draw_ticks
The draw_ticks() method is overridden
by the gtk.Ruler subclasses
(gtk.HRuler
and gtk.VRuler) to draw
the tick marks on the ruler. This method is not used by applications.
gtk.Ruler.draw_pos
The draw_pos() method is overridden by
the gtk.Ruler
subclasses (gtk.HRuler and gtk.VRuler) to draw
the position mark on the ruler. This method is not used by
applications.
gtk.Ruler.get_metric
Returns : | the measurement units currently used for the
ruler |
The get_metric() method returns the
units used for a gtk.Ruler. See the
set_metric()
method.
gtk.Ruler.get_range
Returns> : | a tuple containing: the lower limit of the
ruler, the upper limit of the ruler, the current position of the mark on the
ruler and the maximum size of the ruler used when calculating the space to
leave for the text. |
The get_range() method returns a tuple
containing the values indicating the range and current position of a gtk.Ruler. See the
set_range()
method.