Gnome User Interface Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#include <gnome.h> struct GtkDial; GtkWidget* gtk_dial_new (GtkAdjustment *adjustment); GtkAdjustment* gtk_dial_get_adjustment (GtkDial *dial); void gtk_dial_set_update_policy (GtkDial *dial, GtkUpdateType policy); void gtk_dial_set_adjustment (GtkDial *dial, GtkAdjustment *adjustment); gfloat gtk_dial_set_percentage (GtkDial *dial, gfloat percent); gfloat gtk_dial_get_percentage (GtkDial *dial); gfloat gtk_dial_set_value (GtkDial *dial, gfloat value); gfloat gtk_dial_get_value (GtkDial *dial); void gtk_dial_set_view_only (GtkDial *dial, gboolean view_only); |
This widget provides an analog dial widget, similar to, for example, a physical volume control on a stereo. Dial values can be changable or read-only for value reporting.
GtkWidget* gtk_dial_new (GtkAdjustment *adjustment); |
This function creates a new GtkDial widget, and ties it to a specified GtkAdjustment. When the dial is moved, the adjustment is updated, and vice-versa.
adjustment : | Pointer to GtkAdjustment object |
Returns : | Pointer to new GtkDial widget. |
GtkAdjustment* gtk_dial_get_adjustment (GtkDial *dial); |
Retrieves the GtkAdjustment associated with the GtkDial dial.
dial : | Pointer to GtkDial widget |
Returns : | Pointer to GtkAdjustment object. |
void gtk_dial_set_update_policy (GtkDial *dial, GtkUpdateType policy); |
Sets the update policy of the GtkDial dial to one of either GTK_UPDATE_CONTINUOUS, GTK_UPDATE_DISCONTINUOUS, or GTK_UPDATE_DELAYED. Please see Gtk+ documentation for an explanation of these values.
dial : | Pointer to GtkDial widget |
policy : | New policy type |
void gtk_dial_set_adjustment (GtkDial *dial, GtkAdjustment *adjustment); |
Associates a new GtkAdjustment with GtkDial dial widget. The old adjustment is removed and replaced with the new.
dial : | Pointer to GtkDial widget |
adjustment : | Pointer to GtkAdjustment object |
gfloat gtk_dial_set_percentage (GtkDial *dial, gfloat percent); |
Sets the GtkDial's value to percent of dial->adjustment->upper. The upper value is set when the GtkAdjustment is created.
dial : | Pointer to GtkDial widget |
percent : | New percentage |
Returns : | New value of adjustment. |
gfloat gtk_dial_get_percentage (GtkDial *dial); |
Retrieves the current percentage held in the dial widget.
dial : | Pointer to GtkDial widget |
Returns : | Current percentage. |
gfloat gtk_dial_set_value (GtkDial *dial, gfloat value); |
Sets the current value held in the GtkDial's adjustment object to value.
dial : | Pointer to GtkDial widget |
value : | New value |
Returns : | New percentage of value to the adjustment's upper limit. |
gfloat gtk_dial_get_value (GtkDial *dial); |
Retrieves the current value helt in the dial widget.
dial : | Pointer to GtkDial widget |
Returns : | Current value |
void gtk_dial_set_view_only (GtkDial *dial, gboolean view_only); |
Specifies whether or not the user is to be able to edit the value represented by the dial widget. If view_only is TRUE, the dial will be set to view-only mode, and the user will not be able to edit it. If view_only is FALSE, the user will be able to change the value represented.
dial : | Pointer to GtkDial widget |
view_only : | TRUE to set dial to read-only, FALSE to edit. |