diff options
author | Matthias Clasen <mclasen@redhat.com> | 2008-01-06 06:35:49 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-01-06 06:35:49 +0000 |
commit | f8c2aaf4737af09bc27cf92f8cfa46ab3645455a (patch) | |
tree | 2e2742644a534923189fa2fc5912ad33743b2db6 /gtk/gtkspinbutton.c | |
parent | 71e9be7e6da95f11da67271afb7a8c4fcfa46713 (diff) | |
download | gtk+-f8c2aaf4737af09bc27cf92f8cfa46ab3645455a.tar.gz |
Document the ::output signal and add an example. (#507566, example by Owen
2008-01-06 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkspinbutton.c: Document the ::output signal and
add an example. (#507566, example by Owen Taylor)
svn path=/trunk/; revision=19312
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r-- | gtk/gtkspinbutton.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 7aa6ebaa52..4831ba5d7a 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -290,6 +290,33 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) G_TYPE_INT, 1, G_TYPE_POINTER); + /** + * GtkSpinButton::output: + * @spin_button: the object which received the signal + * + * The ::output signal can be used to change to formatting + * of the value that is displayed in the spin buttons entry. + * |[ + * /* show leading zeros */ + * static gboolean + * on_output (GtkSpinButton *spin, + * gpointer data) + * { + * GtkAdjustment *adj; + * gchar *text; + * + * 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; + * } + * ]| + * + * Returns: %TRUE if the value has been displayed. + */ spinbutton_signals[OUTPUT] = g_signal_new (I_("output"), G_TYPE_FROM_CLASS (gobject_class), |