1998-12-10 17:31:04 +00:00
|
|
|
|
2002-02-16 23:52:30 +00:00
|
|
|
#include <stdlib.h>
|
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");
|
|
|
|
|
2002-02-19 19:47:16 +00:00
|
|
|
g_signal_connect (G_OBJECT (window), "destroy",
|
|
|
|
G_CALLBACK (exit), NULL);
|
1998-03-23 06:36:09 +00:00
|
|
|
|
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);
|
|
|
|
|
2003-01-23 21:08:59 +00:00
|
|
|
/* And attach to its "tictactoe" signal */
|
2002-02-19 19:47:16 +00:00
|
|
|
g_signal_connect (G_OBJECT (ttt), "tictactoe",
|
|
|
|
G_CALLBACK (win), NULL);
|
1998-03-23 06:36:09 +00:00
|
|
|
|
|
|
|
gtk_widget_show (window);
|
|
|
|
|
|
|
|
gtk_main ();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
1998-12-10 17:31:04 +00:00
|
|
|
|