## BtRuler

BtRuler — A ruler widget

## Synopsis

    #include "bt-edit.h"

    struct              BtRuler;
    GtkWidget *         gtk_vumeter_new                     (gboolean vertical);
    void                bt_ruler_set_metric                 (BtRuler *ruler,
                                                             GtkMetricType metric);
    GtkMetricType       bt_ruler_get_metric                 (BtRuler *ruler);
    void                bt_ruler_set_range                  (BtRuler *ruler,
                                                             gdouble lower,
                                                             gdouble upper,
                                                             gdouble position,
                                                             gdouble max_size);
    void                bt_ruler_get_range                  (BtRuler *ruler,
                                                             gdouble *lower,
                                                             gdouble *upper,
                                                             gdouble *position,
                                                             gdouble *max_size);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----BtRuler

## Implemented Interfaces

BtRuler implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Properties

      "draw-pos"                 gboolean              : Read / Write
      "lower"                    gdouble               : Read / Write
      "max-size"                 gdouble               : Read / Write
      "metric"                   GtkMetricType         : Read / Write
      "position"                 gdouble               : Read / Write
      "upper"                    gdouble               : Read / Write

## Description

The Ruler widget is utilized around other widgets such as a text widget or a graph. The ruler is used to show the location of the mouse on the window and to show the size of the window in specified units. The available units of measurement are GTK_PIXELS, GTK_INCHES and GTK_CENTIMETERS. GTK_PIXELS is the default unit of measurement. The ruler widget can be oriented vertically or horizontally.

## Details

### struct BtRuler

    struct BtRuler;

### gtk_vumeter_new ()

    GtkWidget *         gtk_vumeter_new                     (gboolean vertical);

Creates a new VUMeter widget.

`vertical` : | `TRUE` for a vertical VUMeter, `FALSE` for horizontal VUMeter.
Returns : | the new GtkWidget

### bt_ruler_set_metric ()

    void                bt_ruler_set_metric                 (BtRuler *ruler,
                                                             GtkMetricType metric);

### bt_ruler_get_metric ()

    GtkMetricType       bt_ruler_get_metric                 (BtRuler *ruler);

Gets the units used for a BtRuler. See `bt_ruler_set_metric()`.

`ruler` : | a BtRuler
Returns : | the units currently used for `ruler`

### bt_ruler_set_range ()

    void                bt_ruler_set_range                  (BtRuler *ruler,
                                                             gdouble lower,
                                                             gdouble upper,
                                                             gdouble position,
                                                             gdouble max_size);

This sets the range of the ruler.

`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 used when calculating the space to leave for the text

### bt_ruler_get_range ()

    void                bt_ruler_get_range                  (BtRuler *ruler,
                                                             gdouble *lower,
                                                             gdouble *upper,
                                                             gdouble *position,
                                                             gdouble *max_size);

Retrieves values indicating the range and current position of a BtRuler. See `bt_ruler_set_range()`.

`ruler` : | a BtRuler
`lower` : | location to store lower limit of the ruler, or `NULL`. [allow-none]
`upper` : | location to store upper limit of the ruler, or `NULL`. [allow-none]
`position` : | location to store the current position of the mark on the ruler, or `NULL`. [allow-none]
`max_size` : | location to store the maximum size of the ruler used when calculating the space to leave for the text, or `NULL`.

## Property Details

### The `"draw-pos"` property

      "draw-pos"                 gboolean              : Read / Write

Wheter the position should be marked at the ruler.

Default value: TRUE

### The `"lower"` property

      "lower"                    gdouble               : Read / Write

Lower limit of ruler.

Default value: 0

### The `"max-size"` property

      "max-size"                 gdouble               : Read / Write

Maximum size of the ruler.

Default value: 0

### The `"metric"` property

      "metric"                   GtkMetricType         : Read / Write

The metric used for the ruler.

Default value: GTK_PIXELS

### The `"position"` property

      "position"                 gdouble               : Read / Write

Position of mark on the ruler.

Default value: 0

### The `"upper"` property

      "upper"                    gdouble               : Read / Write

Upper limit of ruler.

Default value: 0