Gtk.ScaleButton¶
- Subclasses:
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Orientable (2)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.AccessibleRange (1)
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r/w/en |
|||
[ |
r/w |
||
r/w/en |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted to dismiss the popup. |
|
Emitted to popup the scale widget. |
|
Emitted when the value field has changed. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.ScaleButton(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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 [class`Gtk`.VolumeButton] subclass that is tailored for this use case.
- CSS nodes
`` scalebutton.scale ╰── button.toggle
╰── <icon>
GtkScaleButton
has a single CSS node with name scalebutton and.scale
style class, and contains abutton
node with a.toggle
style class.- classmethod new(min, max, step, icons)[source]¶
- Parameters:
min (
float
) – the minimum value of the scale (usually 0)max (
float
) – the maximum value of the scale (usually 100)step (
float
) – the stepping of value when a scroll-wheel event, or up/down arrow event occurs (usually 2)icons ([
str
] orNone
) – aNone
-terminated array of icon names, orNone
if you want to set the list later withGtk.ScaleButton.set_icons
()
- Returns:
a new
GtkScaleButton
- Return type:
Creates a
GtkScaleButton
.The new scale button has a range between min and max, with a stepping of step.
- get_active()[source]¶
- Returns:
whether the button is pressed
- Return type:
Queries a
GtkScaleButton
and returns its current state.Returns
True
if the scale button is pressed in andFalse
if it is raised.New in version 4.10.
- get_adjustment()[source]¶
- Returns:
the adjustment associated with the scale
- Return type:
Gets the
GtkAdjustment
associated with theGtkScaleButton
’s scale.See [method`Gtk`.Range.get_adjustment] for details.
- get_minus_button()[source]¶
- Returns:
the minus button of the
GtkScaleButton
- Return type:
Retrieves the minus button of the
GtkScaleButton
.
- get_plus_button()[source]¶
- Returns:
the plus button of the
GtkScaleButton
- Return type:
Retrieves the plus button of the
GtkScaleButton.
- get_popup()[source]¶
- Returns:
the popup of the
GtkScaleButton
- Return type:
Retrieves the popup of the
GtkScaleButton
.
- get_value()[source]¶
- Returns:
current value of the scale button
- Return type:
Gets the current value of the scale button.
- set_adjustment(adjustment)[source]¶
- Parameters:
adjustment (
Gtk.Adjustment
) – aGtkAdjustment
Sets the
GtkAdjustment
to be used as a model for theGtkScaleButton
’s scale.See [method`Gtk`.Range.set_adjustment] for details.
- set_value(value)[source]¶
- Parameters:
value (
float
) – new value of the scale button
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 [signal`Gtk`.ScaleButton::value-changed] signal if the value changes.
Signal Details¶
- Gtk.ScaleButton.signals.popdown(scale_button)¶
- Signal Name:
popdown
- Flags:
- Parameters:
scale_button (
Gtk.ScaleButton
) – The object which received the signal
Emitted to dismiss the popup.
This is a keybinding signal.
The default binding for this signal is <kbd>Escape</kbd>.
- Gtk.ScaleButton.signals.popup(scale_button)¶
- Signal Name:
popup
- Flags:
- Parameters:
scale_button (
Gtk.ScaleButton
) – The object which received the signal
Emitted to popup the scale widget.
This is a keybinding signal.
The default bindings for this signal are <kbd>Space</kbd>, <kbd>Enter</kbd> and <kbd>Return</kbd>.
- Gtk.ScaleButton.signals.value_changed(scale_button, value)¶
- Signal Name:
value-changed
- Flags:
- Parameters:
scale_button (
Gtk.ScaleButton
) – The object which received the signalvalue (
float
) – the new value
Emitted when the value field has changed.
Property Details¶
- Gtk.ScaleButton.props.active¶
-
If the scale button should be pressed in.
New in version 4.10.
- Gtk.ScaleButton.props.adjustment¶
- Name:
adjustment
- Type:
- Default Value:
- Flags:
The
GtkAdjustment
that is used as the model.
- Gtk.ScaleButton.props.icons¶
-
The names of the icons to be used by the scale button.
The first item in the array will be used in the button when the current value is the lowest value, the second item for the highest value. All the subsequent icons will be used for all the other values, spread evenly over the range of values.
If there’s only one icon name in the icons array, it will be used for all the values. If only two icon names are in the icons array, the first one will be used for the bottom 50% of the scale, and the second one for the top 50%.
It is recommended to use at least 3 icons so that the
GtkScaleButton
reflects the current value of the scale better for the users.
- Gtk.ScaleButton.props.value¶
- Name:
value
- Type:
- Default Value:
0.0
- Flags:
The value of the scale.