## GtkDataboxRuler GtkDataboxRuler — An improved version of the GtkRuler. |

## Synopsis

    #include <gtkdatabox_ruler.h>

    #define             GTK_DATABOX_RULER_MAX_MAX_LENGTH
                        GtkDataboxRulerPrivate;
                        GtkDataboxRuler;
    GtkWidget*          gtk_databox_ruler_new               (GtkOrientation orientation);
    void                gtk_databox_ruler_set_range         (GtkDataboxRuler *ruler,
                                                             gdouble lower,
                                                             gdouble upper,
                                                             gdouble position);
    void                gtk_databox_ruler_set_max_length    (GtkDataboxRuler *ruler,
                                                             guint max_length);
    void                gtk_databox_ruler_set_scale_type    (GtkDataboxRuler *ruler,
                                                             guint scale_type);
    void                gtk_databox_ruler_get_range         (GtkDataboxRuler *ruler,
                                                             gdouble *lower,
                                                             gdouble *upper,
                                                             gdouble *position);
    guint               gtk_databox_ruler_get_max_length    (GtkDataboxRuler *ruler);
    GtkDataboxScaleType gtk_databox_ruler_get_scale_type    (GtkDataboxRuler *ruler);
    void                gtk_databox_ruler_set_orientation   (GtkDataboxRuler *ruler,
                                                             GtkOrientation orientation);
    GtkOrientation      gtk_databox_ruler_get_orientation   (GtkDataboxRuler *ruler);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkDataboxRuler

## Implemented Interfaces

GtkDataboxRuler implements AtkImplementorIface and GtkBuildable.

## Properties

      "lower"                    gdouble               : Read / Write
      "max-length"               guint                 : Read / Write
      "orientation"              guint                 : Read / Write / Construct Only
      "position"                 gdouble               : Read / Write
      "upper"                    gdouble               : Read / Write

## Description

GtkDataboxRuler is a widget for the GTK+ library similar to GtkRuler.

It is improved in several ways:

- It supports linear and logarithmic scales.

- In the vertical orientation, the labels are rotated 90° (instead of being written as a vertical column of horizontal characters). This increases readability.

- It works for very small and very large value ranges.

## Details

### GTK_DATABOX_RULER_MAX_MAX_LENGTH

    #define GTK_DATABOX_RULER_MAX_MAX_LENGTH 63

The maximum upper limit of label length in characters

### GtkDataboxRulerPrivate

    typedef struct _GtkDataboxRulerPrivate GtkDataboxRulerPrivate;

A private data structure used by the GtkDataboxRuler. It shields all internal things from developers who are just using the object.

### GtkDataboxRuler

    typedef struct _GtkDataboxRuler GtkDataboxRuler;

An improved version (see above) of GtkRuler which supports linear and logarithmic scales.

### gtk_databox_ruler_new ()

    GtkWidget*          gtk_databox_ruler_new               (GtkOrientation orientation);

Creates a new GtkDataboxRuler widget with the given `orientation` (horizontal or vertical).

`orientation` : | orientation of the ruler
Returns : | A new GtkDataboxRuler

### gtk_databox_ruler_set_range ()

    void                gtk_databox_ruler_set_range         (GtkDataboxRuler *ruler,
                                                             gdouble lower,
                                                             gdouble upper,
                                                             gdouble position);

Sets values indicating the range and current position of a GtkDataboxRuler.

See `gtk_databox_ruler_get_range()`.

`ruler` : | a GtkDataboxRuler
`lower` : | lower limit of the ruler
`upper` : | upper limit of the ruler
`position` : | current position of the mark on the ruler

### gtk_databox_ruler_set_max_length ()

    void                gtk_databox_ruler_set_max_length    (GtkDataboxRuler *ruler,
                                                             guint max_length);

This function sets the maximum number of digits to be used for each tick label of the `ruler`.

The `max_length` cannot be smaller than 2 and not bigger than GTK_DATABOX_RULER_MAX_MAX_LENGTH.

`ruler` : | A GtkDataboxRuler widget
`max_length` : | Maximum length (digits) of tick labels

### gtk_databox_ruler_set_scale_type ()

    void                gtk_databox_ruler_set_scale_type    (GtkDataboxRuler *ruler,
                                                             guint scale_type);

This function sets the scale type of the `ruler`.

`ruler` : | A GtkDataboxRuler widget
`scale_type` : | The new scale type for `ruler` (linear or logarithmic)

### gtk_databox_ruler_get_range ()

    void                gtk_databox_ruler_get_range         (GtkDataboxRuler *ruler,
                                                             gdouble *lower,
                                                             gdouble *upper,
                                                             gdouble *position);

Retrieves values indicating the range and current position of a GtkDataboxRuler. See `gtk_databox_ruler_set_range()`.

`ruler` : | a GtkDataboxRuler
`lower` : | location to store lower limit of the ruler, or `NULL`
`upper` : | location to store upper limit of the ruler, or `NULL`
`position` : | location to store the current position of the mark on the ruler, or `NULL`

### gtk_databox_ruler_get_max_length ()

    guint               gtk_databox_ruler_get_max_length    (GtkDataboxRuler *ruler);

This function returns the maximum number of digits to be used for each tick label of the `ruler`.

`ruler` : | A GtkDataboxRuler widget
Returns : | The maximum length of the tick labels.

### gtk_databox_ruler_get_scale_type ()

    GtkDataboxScaleType gtk_databox_ruler_get_scale_type    (GtkDataboxRuler *ruler);

This function returns the scale type of the `ruler` (linear or logarithmic).

`ruler` : | A GtkDataboxRuler widget
Returns : | The scale type (linear or logarithmic)

### gtk_databox_ruler_set_orientation ()

    void                gtk_databox_ruler_set_orientation   (GtkDataboxRuler *ruler,
                                                             GtkOrientation orientation);

Sets the orientation of the `ruler` (horizontal or vertical).

`ruler` : | a GtkDataboxRuler
`orientation` : | new orientation of the ruler

### gtk_databox_ruler_get_orientation ()

    GtkOrientation      gtk_databox_ruler_get_orientation   (GtkDataboxRuler *ruler);

Gets the orientation of the `ruler` (horizontal or vertical).

`ruler` : | a GtkDataboxRuler
Returns : | Orientation of the `ruler`.

## Property Details

### The `"lower"` property

      "lower"                    gdouble               : Read / Write

Lower limit of ruler.

Default value: 0

### The `"max-length"` property

      "max-length"               guint                 : Read / Write

Maximum length of the labels (in digits).

Allowed values: [2,63]

Default value: 6

### The `"orientation"` property

      "orientation"              guint                 : Read / Write / Construct Only

Orientation of the ruler: horizontal or vertical.

Allowed values: <= 1

Default value: 0

### 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

## See Also

GtkDatabox