gtk.ScaleButton
Prev | The gtk Class Reference | Next

## gtk.ScaleButton

gtk.ScaleButton — A button which pops up a scale. (new in PyGTK 2.12)

## Synopsis

    class gtk.ScaleButton(gtk.Button):
        gtk.ScaleButton(size, min, max, step, icons=None)
        def get_adjustment()
        def get_minus_button()
        def get_orientation()
        def get_plus_button()
        def get_popup()
        def get_value()
        def set_adjustment(adjustment)
        def set_icons(icons)
        def set_orientation(icons)
        def set_value(value)

## Ancestry

    +-- gobject.GObject
      +-- gtk.Object
        +-- gtk.Widget
          +-- gtk.Container
            +-- gtk.Bin
              +-- gtk.Button
                +-- gtk.ScaleButton

## Implemented Interfaces

`gtk.ScaleButton` implements `gtk.Buildable`

## gtk.ScaleButton Properties

gtk.Object Properties

gtk.Widget Properties

gtk.Container Properties

gtk.Button Properties

"adjustment" | Read/Write | The `gtk.Adjustment` that contains the current value of this scale button object.

"icons"

Read/Write

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.

"orientation" | Read/Write | The orientation of the `gtk.ScaleButton`'s popup window. Default value: gtk.ORIENTATION_VERTICAL. Available from GTK+ 2.14.
"size" | Read/Write | The icon size. Default value: gtk.ICON_SIZE_SMALL_TOOLBAR.
"value" | Read/Write | The value of the scale. Default value: 0.

## gtk.ScaleButton Style Properties

gtk.Widget Style Properties

gtk.Button Style Properties

## gtk.ScaleButton Signal Prototypes

gobject.GObject Signal Prototypes

gtk.Object Signal Prototypes

gtk.Widget Signal Prototypes

gtk.Container Signal Prototypes

gtk.Button Signal Prototypes

"popdown" | `def callback(`scalebutton`, `user_param1`, `...`)`
"popup" | `def callback(`scalebutton`, `user_param1`, `...`)`
"value-changed" | `def callback(`scalebutton`, `value`, `user_param1`, `...`)`

## Description

`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 a `gtk.VolumeButton` subclass that is tailored for this use case.

## Constructor

        gtk.ScaleButton(size, min, max, step, icons=None)

`size` : | A stock icon size.
`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` : | Optionally a list or tuple of icon names, you will be able to set the list later with `set_icons`
Returns : | a new `gtk.ScaleButton` object.

### Note

This constructor is available in PyGTK 2.12 and above.

Creates a `gtk.ScaleButton`, with a range between `min` and `max`, with a stepping of `step`.

## Methods

### gtk.ScaleButton.get_adjustment

        def get_adjustment()

Returns : | The `gtk.Adjustment` associated with the scale.

### Note

This method is available in PyGTK 2.12 and above.

The `get_adjustment`() method gets the `gtk.Adjustment` associated with the `gtk.ScaleButton`'s scale. See `gtk.Range.get_adjustment` for details.

### gtk.ScaleButton.get_minus_button

        def get_minus_button()

Returns : | the minus button of the `gtk.ScaleButton`.

### Note

This method is available in PyGTK 2.14 and above.

The `get_minus_button`() method retrieves the minus button of the `gtk.ScaleButton`.

### gtk.ScaleButton.get_orientation

        def get_orientation()

Returns : | the `gtk.ScaleButton`'s orientation.

### Note

This method is available in PyGTK 2.14 and above.

The `get_orientation`() method gets the orientation of the `gtk.ScaleButton`'s popup window.

### gtk.ScaleButton.get_plus_button

        def get_plus_button()

Returns : | the plus button of the `gtk.ScaleButton`.

### Note

This method is available in PyGTK 2.14 and above.

The `get_plus_button`() method retrieves the plus button of the `gtk.ScaleButton`.

### gtk.ScaleButton.get_popup

        def get_popup()

Returns : | the popup of the `gtk.ScaleButton`.

### Note

This method is available in PyGTK 2.14 and above.

The `get_popup`() method gets the popup of the `gtk.ScaleButton`.

### gtk.ScaleButton.get_value

        def get_value()

Returns : | The current value of the scale button.

### Note

This method is available in PyGTK 2.12 and above.

The `get_value`() method gets the current value of the scale button.

### gtk.ScaleButton.set_adjustment

        def set_adjustment(adjustment)

`adjustment` : | The `gtk.Adjustment` to set.

### Note

This method is available in PyGTK 2.12 and above.

The `set_adjustment`() method sets the `gtk.Adjustment` to be used as a model for the `gtk.ScaleButton`'s scale. See `gtk.Range.set_adjustment` for details.

### gtk.ScaleButton.set_icons

        def set_icons(icons)

`icons` : | A list or tuple of icon names.

### Note

This method is available in PyGTK 2.12 and above.

The `set_icons`() method sets the icons to be used by the scale button. For details, see the gtk.ScaleButton:icons property for details.

### gtk.ScaleButton.set_orientation

        def set_orientation(icons)

`orientation` : | the new orientation.

### Note

This method is available in PyGTK 2.14 and above.

The `set_orientation`() method sets the orientation of the `gtk.ScaleButton`'s popup window.

### gtk.ScaleButton.set_value

        def set_value(value)

`value` : | The new value of the scale button.

### Note

This method is available in PyGTK 2.12 and above.

The `set_value`() method 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.

## Signals

### The "popdown" gtk.ScaleButton Signal

        def callback(scalebutton, user_param1, ...)

`scalebutton` : | the scalebutton that received the "popdown" signal
`user_param1` : | the first user parameter (if any) specified with the `connect`() method
`...` : | additional user parameters (if any)

### Note

This signal is available in PyGTK 2.12 and above.

The "popdown" signal is a keybinding signal which gets emitted to popdown the scale widget. The default binding for this signal is Escape.

### The "popup" gtk.ScaleButton Signal

        def callback(scalebutton, user_param1, ...)

`scalebutton` : | the scalebutton that received the "popup" signal
`user_param1` : | the first user parameter (if any) specified with the `connect`() method
`...` : | additional user parameters (if any)

### Note

This signal is available in PyGTK 2.12 and above.

The "popup" signal is a keybinding signal which gets emitted to popup the scale widget. The default bindings for this signal are Space, Enter and Return.

### The "value-changed" gtk.ScaleButton Signal

        def callback(scalebutton, value, user_param1, ...)

`scalebutton` : | the scalebutton that received the "value-changed" signal
`value` : | the new value
`user_param1` : | the first user parameter (if any) specified with the `connect`() method
`...` : | additional user parameters (if any)

### Note

This signal is available in PyGTK 2.12 and above.

The "value-changed" signal is emitted when the value field has changed.

Prev | Up | Next
gtk.Scale | Home | gtk.Scrollbar