gtk2/examples/tictactoe/ttt_test.c
CST 1998 Shawn T. Amundson 690e34968a added this directory with stuff from the tutorial, updated to compile and
Mon Mar 23 12:03:03 CST 1998 Shawn T. Amundson <amundson@gtk.org>

        * examples/: added this directory with stuff from
          the tutorial, updated to compile and work with recent
          changes
1998-03-23 06:36:09 +00:00

42 lines
801 B
C

#include <gtk/gtk.h>
#include "tictactoe.h"
void
win (GtkWidget *widget, gpointer data)
{
g_print ("Yay!\n");
tictactoe_clear (TICTACTOE (widget));
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *ttt;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Aspect Frame");
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_exit), NULL);
gtk_container_border_width (GTK_CONTAINER (window), 10);
ttt = tictactoe_new ();
gtk_container_add (GTK_CONTAINER (window), ttt);
gtk_widget_show (ttt);
gtk_signal_connect (GTK_OBJECT (ttt), "tictactoe",
GTK_SIGNAL_FUNC (win), NULL);
gtk_widget_show (window);
gtk_main ();
return 0;
}