GimpUi.Ruler

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GimpUi.Ruler GimpUi.Ruler Gtk.Buildable->Gtk.Widget Gtk.Widget->GimpUi.Ruler

Subclasses:

None

Methods

Inherited:

Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

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

class

new (orientation)

add_track_widget (widget)

get_position ()

get_range ()

get_unit ()

remove_track_widget (widget)

set_position (position)

set_range (lower, upper, max_size)

set_unit (unit)

Virtual Methods

Inherited:

Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Widget (39)

Name

Type

Flags

Short Description

lower

float

r/w

Lower limit of ruler

max-size

float

r/w

Maximum size of the ruler

orientation

Gtk.Orientation

r/w

The orientation of the ruler

position

float

r/w

Position of mark on the ruler

unit

Gimp.Unit

r/w

Unit of ruler

upper

float

r/w

Upper limit of ruler

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

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

Fields

Inherited:

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

Class Details

class GimpUi.Ruler(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

GimpUi.RulerClass

A ruler widget with configurable unit and orientation.

classmethod new(orientation)
Parameters:

orientation (Gtk.Orientation) – the ruler’s orientation.

Returns:

a new GimpUi.Ruler widget.

Return type:

Gtk.Widget

Creates a new ruler.

New in version 2.8.

add_track_widget(widget)
Parameters:

widget (Gtk.Widget) – the track widget to add

Adds a “track widget” to the ruler. The ruler will connect to Gtk.Widget :motion-notify-event: on the track widget and update its position marker accordingly. The marker is correctly updated also for the track widget’s children, regardless of whether they are ordinary children of off-screen children.

New in version 2.8.

get_position()
Returns:

the current position of the self widget.

Return type:

float

New in version 2.8.

get_range()
Returns:

lower:

location to store lower limit of the ruler, or None

upper:

location to store upper limit of the ruler, or None

max_size:

location to store the maximum size of the ruler used when calculating the space to leave for the text, or None.

Return type:

(lower: float, upper: float, max_size: float)

Retrieves values indicating the range and current position of a GimpUi.Ruler. See GimpUi.Ruler.set_range().

New in version 2.8.

get_unit()
Returns:

the unit currently used in the self widget.

Return type:

Gimp.Unit

New in version 2.8.

remove_track_widget(widget)
Parameters:

widget (Gtk.Widget) – the track widget to remove

Removes a previously added track widget from the ruler. See GimpUi.Ruler.add_track_widget().

New in version 2.8.

set_position(position)
Parameters:

position (float) – the position to set the ruler to

This sets the position of the ruler.

New in version 2.8.

set_range(lower, upper, max_size)
Parameters:
  • lower (float) – the lower limit of the ruler

  • upper (float) – the upper limit of the ruler

  • max_size (float) – the maximum size of the ruler used when calculating the space to leave for the text

This sets the range of the ruler.

New in version 2.8.

set_unit(unit)
Parameters:

unit (Gimp.Unit) – the Gimp.Unit to set the ruler to

This sets the unit of the ruler.

New in version 2.8.

Property Details

GimpUi.Ruler.props.lower
Name:

lower

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

Lower limit of ruler

GimpUi.Ruler.props.max_size
Name:

max-size

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

Maximum size of the ruler

GimpUi.Ruler.props.orientation
Name:

orientation

Type:

Gtk.Orientation

Default Value:

Gtk.Orientation.HORIZONTAL

Flags:

READABLE, WRITABLE

The orientation of the ruler

GimpUi.Ruler.props.position
Name:

position

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

Position of mark on the ruler

GimpUi.Ruler.props.unit
Name:

unit

Type:

Gimp.Unit

Default Value:

<Unit object at 0x000000000000 (GimpUnit at 0x0000000)>

Flags:

READABLE, WRITABLE

Unit of ruler

GimpUi.Ruler.props.upper
Name:

upper

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

Upper limit of ruler