/* * This is an example button widget which counts the number of clicks * * It is also showing how you can use inline gtk-doc like documentation * which will be correctly translated and put into the resulting source * file */ class Gtk:Button:Count from Gtk:Button { public int count; argument INT count get { ARG = self->count; } set { self->count = ARG; }; init(self) { self->count = 0; } /** * new: * * Makes a new #GtkButtonCount widget * * Returns: a new widget **/ public GtkWidget * new(void) { return GTK_WIDGET(GET_NEW); } /** * new_with_label: * @label: the label text * * Makes a new #GtkButtonCount widget with a label * * Returns: a new widget **/ public GtkWidget * new_with_label(char *label (check null)) onerror NULL { return GTK_WIDGET(GET_NEW); } override (Gtk:Button) void clicked(Gtk:Button *self (check null type)) { GtkButtonCount *bc = GTK_BUTTON_COUNT(self); bc->count++; PARENT_HANDLER(self); } }