Shumate.Scale

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Shumate.Scale Shumate.Scale Gtk.Widget->Shumate.Scale

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (viewport)

get_max_width ()

get_unit ()

get_viewport ()

set_max_width (value)

set_unit (unit)

set_viewport (viewport)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

max-width

int

r/w

The max width of the scale on screen

unit

Shumate.Unit

r/w

The map scale’s unit

viewport

Shumate.Viewport

r/w

The viewport

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Shumate.Scale(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Shumate.ScaleClass

A widget displaying a scale.

CSS nodes

`` map-scale ├── label[.metric][.imperial] ``

ShumateScale uses a single CSS node with name map-scale, it has up to two childs different labels.

classmethod new(viewport)
Parameters:

viewport (Shumate.Viewport or None) – a Shumate.Viewport

Returns:

a new Shumate.Scale.

Return type:

Shumate.Scale

Creates an instance of Shumate.Scale.

get_max_width()
Returns:

The maximum scale width in pixels.

Return type:

int

Gets the maximum scale width.

get_unit()
Returns:

The unit used by the scale

Return type:

Shumate.Unit

Gets the unit used by the scale.

get_viewport()
Returns:

The Shumate.Viewport used by the scale

Return type:

Shumate.Viewport or None

Gets the viewport used by the scale.

set_max_width(value)
Parameters:

value (int) – the number of pixels

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

set_unit(unit)
Parameters:

unit (Shumate.Unit) – a Shumate.Unit

Sets the scale unit.

set_viewport(viewport)
Parameters:

viewport (Shumate.Viewport or None) – a Shumate.Viewport

Sets the scale viewport.

Property Details

Shumate.Scale.props.max_width
Name:

max-width

Type:

int

Default Value:

150

Flags:

READABLE, WRITABLE

The size of the map scale on screen in pixels.

Shumate.Scale.props.unit
Name:

unit

Type:

Shumate.Unit

Default Value:

Shumate.Unit.BOTH

Flags:

READABLE, WRITABLE

The scale’s units.

Shumate.Scale.props.viewport
Name:

viewport

Type:

Shumate.Viewport

Default Value:

None

Flags:

READABLE, WRITABLE

The viewport to use.