File: test.c

package info (click to toggle)
libsx 2.05-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,372 kB
  • sloc: ansic: 8,540; makefile: 258
file content (33 lines) | stat: -rw-r--r-- 607 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include "libsx.h"


void quit(Widget w, void *data)
{
  CloseWindow();
  ExitMainLoop();
}

void real_quit(Widget w, void *data)
{
  exit(0);
}


main(int argc, char **argv)
{
  MakeButton("Click to Quit", quit, NULL);
  MainLoop();

  MakeWindow("Second Window", NULL, NONEXCLUSIVE_WINDOW);
  MakeButton("Click to Quit", quit, NULL);
  MainLoop();

  MakeWindow("Third Window", NULL, NONEXCLUSIVE_WINDOW);
  MakeButton("Click to Quit", quit, NULL);
  MainLoop();

  MakeWindow("Last Window", NULL, NONEXCLUSIVE_WINDOW);
  MakeButton("My last window.", real_quit, NULL);
  MainLoop();
}