ScaleButton#

class ScaleButton(**properties: Any)#

Superclasses: Widget, InitiallyUnowned, Object

Subclasses: VolumeButton

Implemented Interfaces: Accessible, AccessibleRange, Buildable, ConstraintTarget, Orientable

GtkScaleButton provides a button which pops up a scale widget.

This kind of widget is commonly used for volume controls in multimedia applications, and GTK provides a VolumeButton subclass that is tailored for this use case.

Shortcuts and Gestures#

The following signals have default keybindings:

CSS nodes#

scalebutton.scale
╰── button.toggle
    ╰── <icon>

GtkScaleButton has a single CSS node with name scalebutton and .scale style class, and contains a button node with a .toggle style class.

Constructors#

class ScaleButton
classmethod new(min: float, max: float, step: float, icons: Sequence[str] | None = None) Widget#

Creates a GtkScaleButton.

The new scale button has a range between min and max, with a stepping of step.

Parameters:
  • min – the minimum value of the scale (usually 0)

  • max – the maximum value of the scale (usually 100)

  • step – the stepping of value when a scroll-wheel event, or up/down arrow event occurs (usually 2)

  • icons – a None-terminated array of icon names, or None if you want to set the list later with set_icons()

Methods#

class ScaleButton
get_active() bool#

Queries a GtkScaleButton and returns its current state.

Returns True if the scale button is pressed in and False if it is raised.

Added in version 4.10.

get_adjustment() Adjustment#

Gets the GtkAdjustment associated with the GtkScaleButton’s scale.

See get_adjustment for details.

get_has_frame() bool#

Returns whether the button has a frame.

Added in version 4.14.

get_minus_button() Button#

Retrieves the minus button of the GtkScaleButton.

get_plus_button() Button#

Retrieves the plus button of the GtkScaleButton.

get_popup() Widget#

Retrieves the popup of the GtkScaleButton.

get_value() float#

Gets the current value of the scale button.

set_adjustment(adjustment: Adjustment) None#

Sets the GtkAdjustment to be used as a model for the GtkScaleButton’s scale.

See set_adjustment for details.

Parameters:

adjustment – a GtkAdjustment

set_has_frame(has_frame: bool) None#

Sets the style of the button.

Added in version 4.14.

Parameters:

has_frame – whether the button should have a visible frame

set_icons(icons: Sequence[str]) None#

Sets the icons to be used by the scale button.

Parameters:

icons – a None-terminated array of icon names

set_value(value: float) None#

Sets the current value of the scale.

If the value is outside the minimum or maximum range values, it will be clamped to fit inside them.

The scale button emits the value_changed signal if the value changes.

Parameters:

value – new value of the scale button

Properties#

class ScaleButton
props.active: bool#

The type of the None singleton.

Added in version 4.10.

props.adjustment: Adjustment#

The type of the None singleton.

props.has_frame: bool#

The type of the None singleton.

Added in version 4.14.

props.icons: Sequence[str]#

The type of the None singleton.

props.value: float#

The type of the None singleton.

Signals#

class ScaleButton.signals
popdown() None#

The type of the None singleton.

popup() None#

The type of the None singleton.

value_changed(value: float) None#

The type of the None singleton.

Parameters:

value – the new value

Virtual Methods#

class ScaleButton
do_value_changed(value: float) None#

The type of the None singleton.

Parameters:

value

Fields#

class ScaleButton
parent_instance#