PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/gtk1/examples/ttt_test.pp

https://github.com/slibre/freepascal
Puppet | 43 lines | 30 code | 13 blank | 0 comment | 0 complexity | a9430fa5c3845ed1878ef0238267d88b MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
 1{
 2
 3  Converted from C to Pascal by Frank Loemker
 4  <floemker@techfak.uni-bielefeld.de>
 5}
 6program ttt_test;
 7uses
 8  glib,gdk,gtk,
 9  tictactoe;
10
11procedure win (widget : pGtkWidget ; data: gpointer); cdecl;
12begin
13  writeln ('Yay!');
14  tictactoe_clear (pTICTACTOE (widget));
15end;
16
17
18var
19  window,ttt : pGtkWidget;
20begin
21  gtk_init (@argc, @argv);
22
23  window := gtk_window_new (GTK_WINDOW_TOPLEVEL);
24
25  gtk_window_set_title (pGTKWINDOW (window), 'Aspect Frame');
26
27  gtk_signal_connect (pGTKOBJECT (window), 'destroy',
28                      GTK_SIGNAL_FUNC (@gtk_exit), NIL);
29
30  gtk_container_set_border_width (pGTKCONTAINER (window), 10);
31
32  ttt := tictactoe_new ();
33
34  gtk_container_add (pGTKCONTAINER (window), ttt);
35  gtk_widget_show (ttt);
36
37  gtk_signal_connect (pGTKOBJECT (ttt), 'tictactoe',
38                      GTK_SIGNAL_FUNC (@win), NIL);
39
40  gtk_widget_show (window);
41
42  gtk_main ();
43end.