1998-12-10 17:31:04 +00:00
|
|
|
/* example-start tictactoe ttt_test.c */
|
|
|
|
|
1998-03-23 06:36:09 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include "tictactoe.h"
|
|
|
|
|
1999-11-13 23:06:46 +00:00
|
|
|
void win( GtkWidget *widget,
|
|
|
|
gpointer data )
|
1998-03-23 06:36:09 +00:00
|
|
|
{
|
|
|
|
g_print ("Yay!\n");
|
|
|
|
tictactoe_clear (TICTACTOE (widget));
|
|
|
|
}
|
|
|
|
|
1999-11-13 23:06:46 +00:00
|
|
|
int main( int argc,
|
|
|
|
char *argv[] )
|
1998-03-23 06:36:09 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
|
1999-01-28 10:35:40 +00:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
1998-03-23 06:36:09 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
1998-12-10 17:31:04 +00:00
|
|
|
|
|
|
|
/* example-end */
|