Top |
void | gtk_spin_button_configure () |
GtkWidget * | gtk_spin_button_new () |
GtkWidget * | gtk_spin_button_new_with_range () |
void | gtk_spin_button_set_adjustment () |
GtkAdjustment * | gtk_spin_button_get_adjustment () |
void | gtk_spin_button_set_digits () |
void | gtk_spin_button_set_increments () |
void | gtk_spin_button_set_range () |
gint | gtk_spin_button_get_value_as_int () |
void | gtk_spin_button_set_value () |
void | gtk_spin_button_set_update_policy () |
void | gtk_spin_button_set_numeric () |
void | gtk_spin_button_spin () |
void | gtk_spin_button_set_wrap () |
void | gtk_spin_button_set_snap_to_ticks () |
void | gtk_spin_button_update () |
guint | gtk_spin_button_get_digits () |
void | gtk_spin_button_get_increments () |
gboolean | gtk_spin_button_get_numeric () |
void | gtk_spin_button_get_range () |
gboolean | gtk_spin_button_get_snap_to_ticks () |
GtkSpinButtonUpdatePolicy | gtk_spin_button_get_update_policy () |
gdouble | gtk_spin_button_get_value () |
gboolean | gtk_spin_button_get_wrap () |
GtkAdjustment * | adjustment | Read / Write |
double | climb-rate | Read / Write |
guint | digits | Read / Write |
gboolean | numeric | Read / Write |
gboolean | snap-to-ticks | Read / Write |
GtkSpinButtonUpdatePolicy | update-policy | Read / Write |
double | value | Read / Write |
gboolean | wrap | Read / Write |
void | change-value | Action |
int | input | Run Last |
gboolean | output | Run Last |
void | value-changed | Run Last |
void | wrapped | Run Last |
struct | GtkSpinButton |
enum | GtkSpinButtonUpdatePolicy |
enum | GtkSpinType |
#define | gtk_spin_button_get_value_as_float |
#define | GTK_INPUT_ERROR |
GObject ╰── GInitiallyUnowned ╰── GtkObject ╰── GtkWidget ╰── GtkEntry ╰── GtkSpinButton
GtkSpinButton implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.
void gtk_spin_button_configure (GtkSpinButton *spin_button
,GtkAdjustment *adjustment
,gdouble climb_rate
,guint digits
);
Changes the properties of an existing spin button. The adjustment, climb rate, and number of decimal places are all changed accordingly, after this function call.
GtkWidget * gtk_spin_button_new (GtkAdjustment *adjustment
,gdouble climb_rate
,guint digits
);
GtkWidget * gtk_spin_button_new_with_range (gdouble min
,gdouble max
,gdouble step
);
This is a convenience constructor that allows creation of a numeric
GtkSpinButton without manually creating an adjustment. The value is
initially set to the minimum value and a page increment of 10 * step
is the default. The precision of the spin button is equivalent to the
precision of step
.
Note that the way in which the precision is derived works best if step
is a power of ten. If the resulting precision is not suitable for your
needs, use gtk_spin_button_set_digits()
to correct it.
void gtk_spin_button_set_adjustment (GtkSpinButton *spin_button
,GtkAdjustment *adjustment
);
Replaces the GtkAdjustment associated with spin_button
.
GtkAdjustment *
gtk_spin_button_get_adjustment (GtkSpinButton *spin_button
);
Get the adjustment associated with a GtkSpinButton
void gtk_spin_button_set_digits (GtkSpinButton *spin_button
,guint digits
);
Set the precision to be displayed by spin_button
. Up to 20 digit precision
is allowed.
void gtk_spin_button_set_increments (GtkSpinButton *spin_button
,gdouble step
,gdouble page
);
Sets the step and page increments for spin_button. This affects how quickly the value changes when the spin button's arrows are activated.
void gtk_spin_button_set_range (GtkSpinButton *spin_button
,gdouble min
,gdouble max
);
Sets the minimum and maximum allowable values for spin_button
gint
gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button
);
Get the value spin_button
represented as an integer.
void gtk_spin_button_set_value (GtkSpinButton *spin_button
,gdouble value
);
Set the value of spin_button
.
void gtk_spin_button_set_update_policy (GtkSpinButton *spin_button
,GtkSpinButtonUpdatePolicy policy
);
Sets the update behavior of a spin button. This determines whether the spin button is always updated or only when a valid value is set.
void gtk_spin_button_set_numeric (GtkSpinButton *spin_button
,gboolean numeric
);
Sets the flag that determines if non-numeric text can be typed into the spin button.
void gtk_spin_button_spin (GtkSpinButton *spin_button
,GtkSpinType direction
,gdouble increment
);
Increment or decrement a spin button's value in a specified direction by a specified amount.
spin_button |
||
direction |
a GtkSpinType indicating the direction to spin. |
|
increment |
step increment to apply in the specified direction. |
void gtk_spin_button_set_wrap (GtkSpinButton *spin_button
,gboolean wrap
);
Sets the flag that determines if a spin button value wraps around to the opposite limit when the upper or lower limit of the range is exceeded.
void gtk_spin_button_set_snap_to_ticks (GtkSpinButton *spin_button
,gboolean snap_to_ticks
);
Sets the policy as to whether values are corrected to the nearest step increment when a spin button is activated after providing an invalid value.
void
gtk_spin_button_update (GtkSpinButton *spin_button
);
Manually force an update of the spin button.
guint
gtk_spin_button_get_digits (GtkSpinButton *spin_button
);
Fetches the precision of spin_button
. See gtk_spin_button_set_digits()
.
void gtk_spin_button_get_increments (GtkSpinButton *spin_button
,gdouble *step
,gdouble *page
);
Gets the current step and page the increments used by spin_button
. See
gtk_spin_button_set_increments()
.
gboolean
gtk_spin_button_get_numeric (GtkSpinButton *spin_button
);
Returns whether non-numeric text can be typed into the spin button.
See gtk_spin_button_set_numeric()
.
void gtk_spin_button_get_range (GtkSpinButton *spin_button
,gdouble *min
,gdouble *max
);
Gets the range allowed for spin_button
. See
gtk_spin_button_set_range()
.
gboolean
gtk_spin_button_get_snap_to_ticks (GtkSpinButton *spin_button
);
Returns whether the values are corrected to the nearest step. See
gtk_spin_button_set_snap_to_ticks()
.
GtkSpinButtonUpdatePolicy
gtk_spin_button_get_update_policy (GtkSpinButton *spin_button
);
Gets the update behavior of a spin button. See
gtk_spin_button_set_update_policy()
.
gdouble
gtk_spin_button_get_value (GtkSpinButton *spin_button
);
Get the value in the spin_button
.
gboolean
gtk_spin_button_get_wrap (GtkSpinButton *spin_button
);
Returns whether the spin button's value wraps around to the
opposite limit when the upper or lower limit of the range is
exceeded. See gtk_spin_button_set_wrap()
.
#define gtk_spin_button_get_value_as_float gtk_spin_button_get_value
gtk_spin_button_get_value_as_float
is deprecated and should not be used in newly-written code.
“adjustment”
property“adjustment” GtkAdjustment *
The adjustment that holds the value of the spinbutton.
Owner: GtkSpinButton
Flags: Read / Write
“climb-rate”
property “climb-rate” double
The acceleration rate when you hold down a button.
Owner: GtkSpinButton
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“digits”
property “digits” guint
The number of decimal places to display.
Owner: GtkSpinButton
Flags: Read / Write
Allowed values: <= 20
Default value: 0
“numeric”
property “numeric” gboolean
Whether non-numeric characters should be ignored.
Owner: GtkSpinButton
Flags: Read / Write
Default value: FALSE
“snap-to-ticks”
property “snap-to-ticks” gboolean
Whether erroneous values are automatically changed to a spin button's nearest step increment.
Owner: GtkSpinButton
Flags: Read / Write
Default value: FALSE
“update-policy”
property“update-policy” GtkSpinButtonUpdatePolicy
Whether the spin button should update always, or only when the value is legal.
Owner: GtkSpinButton
Flags: Read / Write
Default value: GTK_UPDATE_ALWAYS
“value”
property “value” double
Reads the current value, or sets a new value.
Owner: GtkSpinButton
Flags: Read / Write
Default value: 0
“shadow-type”
style property“shadow-type” GtkShadowType
Style of bevel around the spin button.
Owner: GtkSpinButton
Flags: Read
Default value: GTK_SHADOW_IN
“change-value”
signalvoid user_function (GtkSpinButton *spinbutton, GtkScrollType arg1, gpointer user_data)
Flags: Action
“input”
signalint user_function (GtkSpinButton *spinbutton, gpointer arg1, gpointer user_data)
Flags: Run Last
“output”
signalgboolean user_function (GtkSpinButton *spin_button, gpointer user_data)
The ::output signal can be used to change to formatting of the value that is displayed in the spin buttons entry.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
/* show leading zeros */ static gboolean on_output (GtkSpinButton *spin, gpointer data) { GtkAdjustment *adj; gchar *text; int value; adj = gtk_spin_button_get_adjustment (spin); value = (int)gtk_adjustment_get_value (adj); text = g_strdup_printf ("%02d", value); gtk_entry_set_text (GTK_ENTRY (spin), text); g_free (text); return TRUE; } |
spin_button |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“value-changed”
signalvoid user_function (GtkSpinButton *spinbutton, gpointer user_data)
Flags: Run Last
“wrapped”
signalvoid user_function (GtkSpinButton *spinbutton, gpointer user_data)
The wrapped signal is emitted right after the spinbutton wraps from its maximum to minimum value or vice-versa.
spinbutton |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10