2 * This is an example button widget which counts the number of clicks
4 * It is also showing how you can use inline gtk-doc like documentation
5 * which will be correctly translated and put into the resulting source
10 class Gtk:Button:Count from Gtk:Button {
13 (nick = _("Count of clicks"),
14 blurb = _("How many times was the button clicked"),
17 /* initially set to 0, even though we have already
18 * set the default above */
20 /* links the count property to the count data member */
25 /* Although we have specified the default in two places
26 * already, this is an example of where else you can put
34 * Makes a new #GtkButtonCount widget
36 * Returns: a new widget
42 /* It's ok to use a normal cast here, as we are sure that we
43 * have gotten the right type */
44 return (GtkWidget *)GET_NEW;
49 * @label: the label text
51 * Makes a new #GtkButtonCount widget with a label
53 * Returns: a new widget
57 new_with_label (char *label (check null)) onerror NULL
59 /* It's ok to use a normal cast here, as we are sure that we
60 * have gotten the right type */
61 GtkWidget *widget = (GtkWidget *)GET_NEW;
62 GtkWidget *label_widget = gtk_label_new (label);
63 gtk_container_add (GTK_CONTAINER (widget), label_widget);
64 gtk_widget_show (label_widget);
70 clicked (Gtk:Button *self (check null type))
72 GtkButtonCount *bc = GTK_BUTTON_COUNT (self);
75 /* runt he parent class handler for clicked */
76 PARENT_HANDLER (self);