GtkScaleButton

GtkScaleButton — A button which pops up a scale

Synopsis


#include <gtk/gtk.h>


                    GtkScaleButton;
GtkWidget*          gtk_scale_button_new                (GtkIconSize size,
                                                         gdouble min,
                                                         gdouble max,
                                                         gdouble step,
                                                         const gchar **icons);
void                gtk_scale_button_set_adjustment     (GtkScaleButton *button,
                                                         GtkAdjustment *adjustment);
void                gtk_scale_button_set_icons          (GtkScaleButton *button,
                                                         const gchar **icons);
void                gtk_scale_button_set_value          (GtkScaleButton *button,
                                                         gdouble value);
GtkAdjustment*      gtk_scale_button_get_adjustment     (GtkScaleButton *button);
gdouble             gtk_scale_button_get_value          (GtkScaleButton *button);


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.

Details

GtkScaleButton

typedef struct {
  GtkButton parent;
  
  GtkWidget *plus_button;
  GtkWidget *minus_button;
} GtkScaleButton;


gtk_scale_button_new ()

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

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 NULL-terminated array of icon names, or NULL if you want to set the list later with gtk_scale_button_set_icons()

Returns :

a new GtkScaleButton

Since 2.12


gtk_scale_button_set_adjustment ()

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.

button :

a GtkScaleButton

adjustment :

a GtkAdjustment

Since 2.12


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 GtkScaleButton:icons property.

button :

a GtkScaleButton

icons :

a NULL-terminated array of icon names

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 GtkScaleButton::value-changed signal if the value changes.

button :

a GtkScaleButton

value :

new value of the scale button

Since 2.12


gtk_scale_button_get_adjustment ()

GtkAdjustment*      gtk_scale_button_get_adjustment     (GtkScaleButton *button);

Gets the GtkAdjustment associated with the GtkScaleButton's scale. See gtk_range_get_adjustment() for details.

button :

a GtkScaleButton

Returns :

the adjustment associated with the scale

Since 2.12


gtk_scale_button_get_value ()

gdouble             gtk_scale_button_get_value          (GtkScaleButton *button);

Gets the current value of the scale button.

button :

a GtkScaleButton

Returns :

current value of the scale button

Since 2.12