:right-sidebar: True Scale =================================================================== .. currentmodule:: gi.repository.Shumate .. class:: Scale(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A widget displaying a scale. CSS nodes -------------------------------------------------------------------------------- .. code-block:: :dedent: map-scale ├── label[.metric][.imperial] ``ShumateScale`` uses a single CSS node with name map-scale, it has up to two childs different labels. Constructors ------------ .. rst-class:: interim-class .. class:: Scale :no-index: .. classmethod:: new(viewport: ~gi.repository.Shumate.Viewport | None = None) -> ~gi.repository.Shumate.Scale Creates an instance of :obj:`~gi.repository.Shumate.Scale`\. :param viewport: a :obj:`~gi.repository.Shumate.Viewport` Methods ------- .. rst-class:: interim-class .. class:: Scale :no-index: .. method:: get_max_width() -> int Gets the maximum scale width. .. method:: get_unit() -> ~gi.repository.Shumate.Unit Gets the unit used by the scale. .. method:: get_viewport() -> ~gi.repository.Shumate.Viewport | None Gets the viewport used by the scale. .. method:: set_max_width(value: int) -> None Sets the maximum width of the scale on the screen in pixels :param value: the number of pixels .. method:: set_unit(unit: ~gi.repository.Shumate.Unit) -> None Sets the scale unit. :param unit: a :obj:`~gi.repository.Shumate.Unit` .. method:: set_viewport(viewport: ~gi.repository.Shumate.Viewport | None = None) -> None Sets the scale viewport. :param viewport: a :obj:`~gi.repository.Shumate.Viewport` Properties ---------- .. rst-class:: interim-class .. class:: Scale :no-index: .. attribute:: props.max_width :type: int The type of the None singleton. .. attribute:: props.unit :type: ~gi.repository.Shumate.Unit The type of the None singleton. .. attribute:: props.viewport :type: ~gi.repository.Shumate.Viewport The type of the None singleton.