GtkScaleButton
GtkScaleButton — A button which pops up a scale
|
|
Includes
#include <gtk/gtk.h>
Description
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 GtkVolumeButton subclass that
is tailored for this use case.
CSS nodes
GtkScaleButton has a single CSS node with name button. To differentiate
it from a plain GtkButton, it gets the .scale style class.
The popup widget that contains the scale has a .scale-popup style class.
Functions
gtk_scale_button_set_icons ()
void
gtk_scale_button_set_icons (GtkScaleButton *button,
const gchar **icons);
Sets the icons to be used by the scale button.
For details, see the “icons” property.
Since: 2.12
gtk_scale_button_set_value ()
void
gtk_scale_button_set_value (GtkScaleButton *button,
gdouble value);
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.
Since: 2.12
gtk_scale_button_get_value ()
gdouble
gtk_scale_button_get_value (GtkScaleButton *button);
Gets the current value of the scale button.
Returns
current value of the scale button
Since: 2.12
Types and Values
struct GtkScaleButton
struct GtkScaleButton;
Property Details
The “adjustment” property
“adjustment” GtkAdjustment *
The GtkAdjustment that contains the current value of this scale button object.
Owner: GtkScaleButton
Flags: Read / Write
The “icons” property
“icons” GStrv
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.
Owner: GtkScaleButton
Flags: Read / Write
Since: 2.12
The “size” property
“size” GtkIconSize
The icon size.
Owner: GtkScaleButton
Flags: Read / Write
Default value: GTK_ICON_SIZE_SMALL_TOOLBAR
The “value” property
“value” gdouble
The value of the scale.
Owner: GtkScaleButton
Flags: Read / Write
Default value: 0
Signal Details
The “popdown” signal
void
user_function (GtkScaleButton *button,
gpointer user_data)
The ::popdown signal is a
keybinding signal
which gets emitted to popdown the scale widget.
The default binding for this signal is Escape.
Flags: Action
Since: 2.12
The “popup” signal
void
user_function (GtkScaleButton *button,
gpointer user_data)
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.
Flags: Action
Since: 2.12
The “value-changed” signal
void
user_function (GtkScaleButton *button,
gdouble value,
gpointer user_data)
The ::value-changed signal is emitted when the value field has
changed.
Flags: Run Last
Since: 2.12