libchamplain Reference Manual: ChamplainScale

## ChamplainScale ChamplainScale — An actor displaying a scale. |

## Functions

ClutterActor * | champlain_scale_new ()
void | champlain_scale_set_max_width ()
void | champlain_scale_set_unit ()
guint | champlain_scale_get_max_width ()
ChamplainUnit | champlain_scale_get_unit ()
void | champlain_scale_connect_view ()
void | champlain_scale_disconnect_view ()

## Properties

guint | max-width | Read / Write
ChamplainUnit | unit | Read / Write

## Types and Values

struct | ChamplainScale
enum | ChamplainUnit

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── ClutterActor
                ╰── ChamplainScale

## Implemented Interfaces

ChamplainScale implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

## Description

An actor displaying a scale.

## Functions

### champlain_scale_new ()

    ClutterActor *
    champlain_scale_new (void);

Creates an instance of ChamplainScale.

#### Returns

a new ChamplainScale.

Since 0.10

### champlain_scale_set_max_width ()

    void
    champlain_scale_set_max_width (ChamplainScale *scale,
                                   guint value);

Sets the maximum width of the scale on the screen in pixels

#### Parameters

scale | a ChamplainScale |
value | the number of pixels |

Since 0.10

### champlain_scale_set_unit ()

    void
    champlain_scale_set_unit (ChamplainScale *scale,
                              ChamplainUnit unit);

Sets the scale unit.

#### Parameters

scale | a ChamplainScale |
unit | a ChamplainUnit |

Since 0.10

### champlain_scale_get_max_width ()

    guint
    champlain_scale_get_max_width (ChamplainScale *scale);

Gets the maximum scale width.

#### Parameters

scale | a ChamplainScale |

#### Returns

The maximum scale width in pixels.

Since 0.10

### champlain_scale_get_unit ()

    ChamplainUnit
    champlain_scale_get_unit (ChamplainScale *scale);

Gets the unit used by the scale.

#### Parameters

scale | a ChamplainScale |

#### Returns

The unit used by the scale

Since 0.10

### champlain_scale_connect_view ()

    void
    champlain_scale_connect_view (ChamplainScale *scale,
                                  ChamplainView *view);

This method connects to the necessary signals of ChamplainView to make the scale adapt to the current latitude and longitude.

#### Parameters

scale | a ChamplainScale |
view | a ChamplainView |

Since 0.10

### champlain_scale_disconnect_view ()

    void
    champlain_scale_disconnect_view (ChamplainScale *scale);

This method disconnects from the signals previously connected by `champlain_scale_connect_view()`.

#### Parameters

scale | a ChamplainScale |

Since 0.10

## Types and Values

### struct ChamplainScale

    struct ChamplainScale;

The ChamplainScale structure contains only private data and should be accessed using the provided API

Since 0.10

### enum ChamplainUnit

Units used by the scale.

#### Members

CHAMPLAIN_UNIT_KM | kilometers |
CHAMPLAIN_UNIT_MILES | miles |

## Property Details

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

      “max-width”                guint

The size of the map scale on screen in pixels.

Flags: Read / Write

Allowed values: [1,2000]

Default value: 100

Since 0.10

### The `“unit”` property

      “unit”                     ChamplainUnit

The scale's units.

Flags: Read / Write

Default value: CHAMPLAIN_UNIT_KM

Since 0.10