2 First run tutorial.glade through gtk-builder-convert with this command:
3 gtk-builder-convert tutorial.glade tutorial.xml
5 Then save this file as main.c and compile it using this command
6 (those are backticks, not single quotes):
7 gcc -Wall -g -o tutorial main.c `pkg-config --cflags --libs gtk+-2.0` -export-dynamic
18 GtkWidget
*window
, *button1
, *entry1
;
21 void on_window_destroy (GtkObject
*object
, gpointer user_data
)
26 void on_button1_clicked() {
28 puts(gtk_entry_get_text(entry1
));
29 //gtk_button_set_label(button1, "lol");
30 gtk_button_set_label(button1
, gtk_entry_get_text(entry1
));
33 int main (int argc
, char *argv
[])
35 gtk_init (&argc
, &argv
);
37 builder
= gtk_builder_new ();
38 gtk_builder_add_from_file (builder
, "test.xml", NULL
);
39 window
= GTK_WIDGET (gtk_builder_get_object (builder
, "window"));
41 button1
= GTK_WIDGET (gtk_builder_get_object (builder
, "button1"));
42 entry1
= GTK_WIDGET (gtk_builder_get_object (builder
, "entry1"));
45 gtk_builder_connect_signals (builder
, NULL
);
47 g_object_unref (G_OBJECT (builder
));
49 gtk_widget_show (window
);
This page took 0.8966 seconds and 4 git commands to generate.