gtk.Ruler — a base class for horizontal or vertical rulers
class gtk.Ruler(gtk.Widget): |
|
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.
def 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
.
def set_range(lower
, upper
, position
, max_size
)
| the upper limit of the ruler |
| the lower limit of the ruler |
| the position of the mark on the ruler |
| 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).
def 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.
def 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.
def 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.
def 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.