Ticket #64484: gtk-test.c

File gtk-test.c, 441 bytes (added by dqh-au, 3 years ago)

GTK hello world test program

Line 
1#include <gtk/gtk.h>
2
3/*
4 * gcc $(pkg-config --libs --cflags gtk+-3.0) -o gtk-test gtk-test.c
5 */
6
7int main(int argc, char *argv[])
8{
9    GtkWidget *window;
10
11    gtk_init (&argc, &argv);
12
13    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
14    gtk_window_set_title (GTK_WINDOW (window), "Window");
15
16    g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
17
18    gtk_widget_show (window);
19
20    gtk_main ();
21
22    return 0;
23}
24