Top | ![]() |
![]() |
![]() |
![]() |
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.
GtkScaleButton has a single CSS node with name button. To differentiate it from a plain GtkButton, it gets the .scale style class.
GtkWidget * gtk_scale_button_new (GtkIconSize size
,gdouble min
,gdouble max
,gdouble step
,const gchar **icons
);
Creates a GtkScaleButton, with a range between min
and max
, with
a stepping of step
.
size |
a stock icon size (GtkIconSize). |
[type int] |
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 |
a |
[allow-none][array zero-terminated=1] |
Since: 2.12
void gtk_scale_button_set_adjustment (GtkScaleButton *button
,GtkAdjustment *adjustment
);
Sets the GtkAdjustment to be used as a model
for the GtkScaleButton’s scale.
See gtk_range_set_adjustment()
for details.
Since: 2.12
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
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
GtkAdjustment *
gtk_scale_button_get_adjustment (GtkScaleButton *button
);
Gets the GtkAdjustment associated with the GtkScaleButton’s scale.
See gtk_range_get_adjustment()
for details.
Since: 2.12
gdouble
gtk_scale_button_get_value (GtkScaleButton *button
);
Gets the current value of the scale button.
Since: 2.12
GtkWidget *
gtk_scale_button_get_popup (GtkScaleButton *button
);
Retrieves the popup of the GtkScaleButton.
Since: 2.14
GtkWidget *
gtk_scale_button_get_plus_button (GtkScaleButton *button
);
Retrieves the plus button of the GtkScaleButton.
Since: 2.14
GtkWidget *
gtk_scale_button_get_minus_button (GtkScaleButton *button
);
Retrieves the minus button of the GtkScaleButton.
Since: 2.14