mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
5496e6afc5
Thu Jan 23 20:56:56 GMT 2003 Tony Gale <gale@gtk.org> * Sebastian Rittau <srittau@jroger.in-berlin.de>: docs/tutorial/gtk-tut.sgml: Adopted chapter 21.3 "Creating a Composite widget" to modern standards. (I.e. use gobject instead of glib, derive from GtkTable instead of GtkVBox.) Bugzilla #103869. * docs/tutorial/gtk-tut.sgml, examples/tictactoe: Fixup tic-tac-toe code in Appendix C to reflect above changes. * examples/rangewidgets/rangewidgets.c: From Roger Leigh auto resize on page size change
46 lines
871 B
C
46 lines
871 B
C
|
|
#include <stdlib.h>
|
|
#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");
|
|
|
|
g_signal_connect (G_OBJECT (window), "destroy",
|
|
G_CALLBACK (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);
|
|
|
|
/* And attach to its "tictactoe" signal */
|
|
g_signal_connect (G_OBJECT (ttt), "tictactoe",
|
|
G_CALLBACK (win), NULL);
|
|
|
|
gtk_widget_show (window);
|
|
|
|
gtk_main ();
|
|
|
|
return 0;
|
|
}
|
|
|