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;
}
|