2 #include <libchimara/chimara-if.h>
5 main(int argc, char *argv[])
7 GtkWidget *window, *glk;
9 /* Initialize threads and GTK */
10 if(!g_thread_supported())
13 gtk_init(&argc, &argv);
15 /* Construct the window and its contents. We quit the GTK main loop
16 * when the window's close button is clicked. */
17 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
18 g_signal_connect(window, "delete-event", G_CALLBACK(gtk_main_quit), NULL);
19 glk = chimara_glk_new();
20 gtk_container_add(GTK_CONTAINER(window), glk);
21 gtk_widget_show_all(window);
23 /* Add a reference to the ChimaraGlk widget, because we want to keep it
24 around after gtk_main() exits */
27 /* Start the GTK main loop */
32 /* After the GTK main loop exits, signal the Glk program to shut down if
33 * it is still running, and wait for it to exit. */
34 chimara_glk_stop(CHIMARA_GLK(glk));
35 chimara_glk_wait(CHIMARA_GLK(glk));