GtkRuler: GTK+ 2 Reference Manual

## GtkRuler GtkRuler |

## Functions

void | gtk_ruler_set_metric ()
void | gtk_ruler_set_range ()
GtkMetricType | gtk_ruler_get_metric ()
void | gtk_ruler_get_range ()

## Properties

double | lower | Read / Write
double | max-size | Read / Write
GtkMetricType | metric | Read / Write
double | position | Read / Write
double | upper | Read / Write

## Types and Values

struct | GtkRuler
struct | GtkRulerMetric

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkObject
                ╰── GtkWidget
                    ╰── GtkRuler
                        ├── GtkHRuler
                        ╰── GtkVRuler

## Implemented Interfaces

GtkRuler implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Includes

    #include <gtk/gtk.h>

## Description

## Functions

### gtk_ruler_set_metric ()

    void
    gtk_ruler_set_metric (GtkRuler *ruler,
                          GtkMetricType metric);

`gtk_ruler_set_metric` is deprecated and should not be used in newly-written code.

### gtk_ruler_set_range ()

    void
    gtk_ruler_set_range (GtkRuler *ruler,
                         gdouble lower,
                         gdouble upper,
                         gdouble position,
                         gdouble max_size);

`gtk_ruler_set_range` is deprecated and should not be used in newly-written code.

This sets the range of the ruler.

`Deprecated` : 2.24: GtkRuler has been removed from GTK 3 for being unmaintained and too specialized. There is no replacement.

#### Parameters

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 |

### gtk_ruler_get_metric ()

    GtkMetricType
    gtk_ruler_get_metric (GtkRuler *ruler);

`gtk_ruler_get_metric` is deprecated and should not be used in newly-written code.

Gets the units used for a GtkRuler. See `gtk_ruler_set_metric()`.

#### Parameters

ruler | a GtkRuler |

#### Returns

the units currently used for `ruler`

`Deprecated` : 2.24: GtkRuler has been removed from GTK 3 for being unmaintained and too specialized. There is no replacement.

### gtk_ruler_get_range ()

    void
    gtk_ruler_get_range (GtkRuler *ruler,
                         gdouble *lower,
                         gdouble *upper,
                         gdouble *position,
                         gdouble *max_size);

`gtk_ruler_get_range` is deprecated and should not be used in newly-written code.

Retrieves values indicating the range and current position of a GtkRuler. See `gtk_ruler_set_range()`.

`Deprecated` : 2.24: GtkRuler has been removed from GTK 3 for being unmaintained and too specialized. There is no replacement.

#### Parameters

ruler | a GtkRuler |
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`. |

## Types and Values

### struct GtkRuler

    struct GtkRuler;

`GtkRuler` is deprecated and should not be used in newly-written code.

### struct GtkRulerMetric

    struct GtkRulerMetric {
      gchar *metric_name;
      gchar *abbrev;
      /* This should be points_per_unit. This is the size of the unit
       * in 1/72nd's of an inch and has nothing to do with screen pixels */
      gdouble pixels_per_unit;
      gdouble ruler_scale[10];
      gint subdivide[5];        /* five possible modes of subdivision */
    };

`GtkRulerMetric` is deprecated and should not be used in newly-written code.

## Property Details

### The `“lower”` property

      “lower”                    double

Lower limit of ruler.

Owner: GtkRuler

Flags: Read / Write

Default value: 0

### The `“max-size”` property

      “max-size”                 double

Maximum size of the ruler.

Owner: GtkRuler

Flags: Read / Write

Default value: 0

### The `“metric”` property

      “metric”                   GtkMetricType

The metric used for the ruler.

Owner: GtkRuler

Flags: Read / Write

Default value: GTK_PIXELS

Since: 2.8

### The `“position”` property

      “position”                 double

Position of mark on the ruler.

Owner: GtkRuler

Flags: Read / Write

Default value: 0

### The `“upper”` property

      “upper”                    double

Upper limit of ruler.

Owner: GtkRuler

Flags: Read / Write

Default value: 0