3 static void print_hello(GtkWidget
*widget
__attribute__((unused
)),
4 gpointer data
__attribute__((unused
))) {
5 g_print("Hello World\n");
8 static void activate(GtkApplication
*app
,
9 gpointer user_data
__attribute__((unused
))) {
13 window
= gtk_application_window_new(app
);
14 gtk_window_set_title(GTK_WINDOW(window
), "Window");
15 gtk_window_set_default_size(GTK_WINDOW(window
), 200, 200);
17 button
= gtk_button_new_with_label("Hello World");
18 g_signal_connect(button
, "clicked", G_CALLBACK(print_hello
), NULL
);
19 gtk_window_set_child(GTK_WINDOW(window
), button
);
21 gtk_window_present(GTK_WINDOW(window
));
24 int main(int argc
, char **argv
) {
28 app
= gtk_application_new("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS
);
29 g_signal_connect(app
, "activate", G_CALLBACK(activate
), NULL
);
30 status
= g_application_run(G_APPLICATION(app
), argc
, argv
);