Package ch.bailu.gtk.gtk
Interface SpinButton.OnOutput
- Enclosing class:
- SpinButton
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
onOutput()
Emitted to tweak the formatting of the value for display.
-
Method Details
-
onOutput
boolean onOutput()Emitted to tweak the formatting of the value for display.
```c
// show leading zeros
static gboolean
on_output (GtkSpinButton *spin,
gpointer data)
{
GtkAdjustment *adjustment;
char *text;
int value;
adjustment = gtk_spin_button_get_adjustment (spin);
value = (int)gtk_adjustment_get_value (adjustment);
text = g_strdup_printf ("%02d", value);
gtk_editable_set_text (GTK_EDITABLE (spin), text):
g_free (text);
return TRUE;
}
```- Returns:
- %TRUE if the value has been displayed
-