Gtk.ScaleButton¶
- Subclasses:
Methods¶
- Inherited:
Gtk.Button (29), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Actionable (5), Gtk.Activatable (6), Gtk.Orientable (2)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Button (6), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Actionable (4), Gtk.Activatable (2)
|
Properties¶
- Inherited:
Gtk.Button (9), Gtk.Container (3), Gtk.Widget (39), Gtk.Actionable (2), Gtk.Activatable (2), Gtk.Orientable (1)
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The |
||
[ |
r/w |
List of icon names |
|
r/w/en |
The icon size |
||
r/w/en |
The value of the scale |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Short Description |
---|---|
The |
|
The |
|
The |
Fields¶
- Inherited:
Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Gtk.ScaleButton(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Gtk.ScaleButton
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 aGtk.VolumeButton
subclass that is tailored for this use case.- CSS nodes
Gtk.ScaleButton
has a single CSS node with name button. To differentiate it from a plainGtk.Button
, it gets the .scale style class.The popup widget that contains the scale has a .scale-popup style class.
- classmethod new(size, min, max, step, icons)[source]¶
- Parameters:
size (
int
) – a stock icon size (Gtk.IconSize
)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
Gtk.ScaleButton
- Return type:
Creates a
Gtk.ScaleButton
, with a range between min and max, with a stepping of step.New in version 2.12.
- get_adjustment()[source]¶
- Returns:
the adjustment associated with the scale
- Return type:
Gets the
Gtk.Adjustment
associated with theGtk.ScaleButton
’s scale. SeeGtk.Range.get_adjustment
() for details.New in version 2.12.
- get_minus_button()[source]¶
- Returns:
the minus button of the
Gtk.ScaleButton
as aGtk.Button
- Return type:
Retrieves the minus button of the
Gtk.ScaleButton
.New in version 2.14.
- get_plus_button()[source]¶
- Returns:
the plus button of the
Gtk.ScaleButton
as aGtk.Button
- Return type:
Retrieves the plus button of the
Gtk.ScaleButton
.New in version 2.14.
- get_popup()[source]¶
- Returns:
the popup of the
Gtk.ScaleButton
- Return type:
Retrieves the popup of the
Gtk.ScaleButton
.New in version 2.14.
- get_value()[source]¶
- Returns:
current value of the scale button
- Return type:
Gets the current value of the scale button.
New in version 2.12.
- set_adjustment(adjustment)[source]¶
- Parameters:
adjustment (
Gtk.Adjustment
) – aGtk.Adjustment
Sets the
Gtk.Adjustment
to be used as a model for theGtk.ScaleButton
’s scale. SeeGtk.Range.set_adjustment
() for details.New in version 2.12.
- set_icons(icons)[source]¶
-
Sets the icons to be used by the scale button. For details, see the
Gtk.ScaleButton
:icons
property.New in version 2.12.
- 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
Gtk.ScaleButton
::value-changed
signal if the value changes.New in version 2.12.
Signal Details¶
- Gtk.ScaleButton.signals.popdown(scale_button)¶
- Signal Name:
popdown
- Flags:
- Parameters:
scale_button (
Gtk.ScaleButton
) – The object which received the signal
The
::popdown
signal is akeybinding signal
which gets emitted to popdown the scale widget.The default binding for this signal is Escape.
New in version 2.12.
- Gtk.ScaleButton.signals.popup(scale_button)¶
- Signal Name:
popup
- Flags:
- Parameters:
scale_button (
Gtk.ScaleButton
) – The object which received the signal
The
::popup
signal is akeybinding signal
which gets emitted to popup the scale widget.The default bindings for this signal are Space, Enter and Return.
New in version 2.12.
- 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
The
::value-changed
signal is emitted when the value field has changed.New in version 2.12.
Property Details¶
- Gtk.ScaleButton.props.adjustment¶
- Name:
adjustment
- Type:
- Default Value:
- Flags:
The
Gtk.Adjustment
that contains the current value of this scale button object
- 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
Gtk.ScaleButton
reflects the current value of the scale better for the users.New in version 2.12.
- Gtk.ScaleButton.props.size¶
- Name:
size
- Type:
- Default Value:
- Flags:
The icon size
- Gtk.ScaleButton.props.value¶
- Name:
value
- Type:
- Default Value:
0.0
- Flags:
The value of the scale