1 /* GTK Hello world! by Harvie 2oo9
4 * gcc -o hello hello.c $(pkg-config --cflags --libs gtk+-2.0) -export-dynamic
6 * gcc -Wall -g -o hello hello.c `pkg-config --cflags --libs gtk+-2.0` -export-dynamic
14 GtkWidget
*window1
, *button1
, *entry1
;
16 void on_window1_destroy (GtkObject
*object
, gpointer user_data
)
21 void on_button1_clicked() {
22 gtk_button_set_label(button1
, gtk_entry_get_text(entry1
));
23 puts(gtk_entry_get_text(entry1
));
26 int main (int argc
, char *argv
[])
28 gtk_init(&argc
, &argv
);
30 builder
= gtk_builder_new();
31 gtk_builder_add_from_file(builder
, "hello.ui", NULL
);
33 window1
= GTK_WIDGET (gtk_builder_get_object (builder
, "window1"));
34 button1
= GTK_WIDGET (gtk_builder_get_object (builder
, "button1"));
35 entry1
= GTK_WIDGET (gtk_builder_get_object (builder
, "entry1"));
37 gtk_builder_connect_signals(builder
, NULL
);
39 g_object_unref(G_OBJECT (builder
));
41 gtk_widget_show(window1
);
This page took 0.456359 seconds and 4 git commands to generate.