3 static void print_hello(GtkWidget
*widget
, gpointer data
) {
4 g_print("Hello World\n");
7 static void activate(GtkApplication
*app
, gpointer user_data
) {
11 window
= gtk_application_window_new(app
);
12 gtk_window_set_title(GTK_WINDOW(window
), "Window");
13 gtk_window_set_default_size(GTK_WINDOW(window
), 200, 200);
15 button
= gtk_button_new_with_label("Hello World");
16 g_signal_connect(button
, "clicked", G_CALLBACK(print_hello
), NULL
);
17 gtk_window_set_child(GTK_WINDOW(window
), button
);
19 gtk_window_present(GTK_WINDOW(window
));
22 int main(int argc
, char **argv
) {
26 app
= gtk_application_new("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS
);
27 g_signal_connect(app
, "activate", G_CALLBACK(activate
), NULL
);
28 status
= g_application_run(G_APPLICATION(app
), argc
, argv
);