File: test.c

package info (click to toggle)
libsx 2.08-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,732 kB
  • sloc: ansic: 8,713; sh: 8,603; makefile: 63
file content (35 lines) | stat: -rw-r--r-- 643 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
34
35
#include <stdio.h>
#include <stdlib.h>
#include "libsx.h"


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

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


int 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();
  return 0;
}