mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-19 09:50:06 +00:00
ee3d137660
Sat Nov 13 22:30:29 GMT 1999 Tony Gale <gale@gtk.org> * docs/gtkfaq.sgml: threads example from Erik Mouw. New question on GtkLabel background colors. * docs/gtk_tut.sgml: - Correct the example code callback function definitions. - Update the gtkdial example code, from Frans van Schaik. - Update setselection.c to current API. * examples/Makefile examples/*/*.c: Update to code listed in tutorial.
46 lines
891 B
C
46 lines
891 B
C
/* example-start tictactoe ttt_test.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_set_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;
|
|
}
|
|
|
|
/* example-end */
|