Gtk.ScaleButton¶
| Subclasses: | Gtk.VolumeButton | 
|---|
Methods¶
| class | new(size, min, max, step, icons) | 
| get_adjustment() | |
| get_minus_button() | |
| get_plus_button() | |
| get_popup() | |
| get_value() | |
| set_adjustment(adjustment) | |
| set_icons(icons) | |
| set_value(value) | 
Virtual Methods¶
| Inherited: | Gtk.Button (6), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Actionable (4), Gtk.Activatable (2) | 
|---|
| do_value_changed(value) | 
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 | 
|---|---|---|---|
| adjustment | Gtk.Adjustment | r/w | The Gtk.Adjustmentthat contains the current value of this scale button object | 
| icons | [ str] | r/w | List of icon names | 
| size | Gtk.IconSize | r/w/en | The icon size | 
| value | float | r/w/en | The value of the scale | 
Style Properties¶
| Inherited: | Gtk.Button (7), Gtk.Widget (17) | 
|---|
Signals¶
| Inherited: | Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| popdown | The ::popdownsignal is akeybinding signalwhich gets emitted to popdown the scale widget. | 
| popup | The ::popupsignal is akeybinding signalwhich gets emitted to popup the scale widget. | 
| value-changed | The ::value-changedsignal is emitted when the value field has changed. | 
Fields¶
| Inherited: | Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | Gtk.Button | r | 
Class Details¶
- 
class Gtk.ScaleButton(*args, **kwargs)¶
- Bases: - Gtk.Button,- Gtk.Orientable- Abstract: - No - Structure: - Gtk.ScaleButtonClass- Gtk.ScaleButtonprovides 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- Gtk.VolumeButtonsubclass that is tailored for this use case.- CSS nodes
 - Gtk.ScaleButtonhas a single CSS node with name button. To differentiate it from a plain- Gtk.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, orNoneif 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. 
- size (
 - 
get_adjustment()[source]¶
- Returns: - the adjustment associated with the scale - Return type: - Gtk.Adjustment- Gets the - Gtk.Adjustmentassociated with the- Gtk.ScaleButton’s scale. See- Gtk.Range.get_adjustment() for details.- New in version 2.12. 
 - Returns: - the minus button of the - Gtk.ScaleButtonas a- Gtk.Button- Return type: - Gtk.Button- Retrieves the minus button of the - Gtk.ScaleButton.- New in version 2.14. 
 - Returns: - the plus button of the - Gtk.ScaleButtonas a- Gtk.Button- Return type: - Gtk.Button- 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: - Gtk.Widget- Retrieves the popup of the - Gtk.ScaleButton.- New in version 2.14. 
 - 
get_value()[source]¶
- Returns: - current value of the scale button - Return type: - float- Gets the current value of the scale button. - New in version 2.12. 
 - 
set_adjustment(adjustment)[source]¶
- Parameters: - adjustment ( - Gtk.Adjustment) – a- Gtk.Adjustment- Sets the - Gtk.Adjustmentto be used as a model for the- Gtk.ScaleButton’s scale. See- Gtk.Range.set_adjustment() for details.- New in version 2.12. 
 - 
set_icons(icons)[source]¶
- Parameters: - icons ([ - str]) – a- None-terminated array of icon names- Sets the icons to be used by the scale button. For details, see the - Gtk.ScaleButton- :iconsproperty.- 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-changedsignal if the value changes.- New in version 2.12. 
 
Signal Details¶
- 
Gtk.ScaleButton.signals.popdown(scale_button)¶
- Signal Name: - popdown- Flags: - RUN_LAST,- ACTION- Parameters: - scale_button ( - Gtk.ScaleButton) – The object which received the signal- The - ::popdownsignal is a- keybinding signalwhich 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: - RUN_LAST,- ACTION- Parameters: - scale_button ( - Gtk.ScaleButton) – The object which received the signal- The - ::popupsignal is a- keybinding signalwhich 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 signal
- value (float) – the new value
 - The - ::value-changedsignal is emitted when the value field has changed.- New in version 2.12. 
- scale_button (
Property Details¶
- 
Gtk.ScaleButton.props.adjustment¶
- Name: - adjustment- Type: - Gtk.Adjustment- Default Value: - None- Flags: - READABLE,- WRITABLE- The - Gtk.Adjustmentthat contains the current value of this scale button object
- 
Gtk.ScaleButton.props.icons¶
- Name: - icons- Type: - [ - str]- Default Value: - []- Flags: - READABLE,- WRITABLE- 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.ScaleButtonreflects the current value of the scale better for the users.- New in version 2.12. 
- 
Gtk.ScaleButton.props.size¶
- Name: - size- Type: - Gtk.IconSize- Default Value: - Gtk.IconSize.SMALL_TOOLBAR- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The icon size 
- 
Gtk.ScaleButton.props.value¶
- Name: - value- Type: - float- Default Value: - 0.0- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The value of the scale