GtkDataboxRuler

GtkDataboxRuler — An improved version of the GtkRuler.

Functions

Properties

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

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkObject
            ╰── GtkWidget
                ╰── GtkDataboxRuler

Implemented Interfaces

GtkDataboxRuler implements AtkImplementorIface and GtkBuildable.

Includes

#include <gtkdatabox_ruler.h>

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.

Functions

gtk_databox_ruler_new ()

GtkWidget *
gtk_databox_ruler_new (GtkOrientation orientation);

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

Parameters

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().

Parameters

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.

Parameters

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 .

Parameters

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().

Parameters

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 .

Parameters

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).

Parameters

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).

Parameters

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).

Parameters

ruler

a GtkDataboxRuler

 

Returns

Orientation of the ruler .

Types and Values

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.


struct GtkDataboxRuler

struct GtkDataboxRuler;

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

Property Details

The “lower” property

  “lower”                    gdouble

Lower limit of ruler.

Flags: Read / Write

Default value: 0


The “max-length” property

  “max-length”               guint

Maximum length of the labels (in digits).

Flags: Read / Write

Allowed values: [2,63]

Default value: 6


The “orientation” property

  “orientation”              guint

Orientation of the ruler: horizontal or vertical.

Flags: Read / Write / Construct Only

Allowed values: <= 1

Default value: 0


The “position” property

  “position”                 gdouble

Position of mark on the ruler.

Flags: Read / Write

Default value: 0


The “upper” property

  “upper”                    gdouble

Upper limit of ruler.

Flags: Read / Write

Default value: 0

See Also

GtkDatabox