4
char *XCursesProgramName="sillyness_ex";
9
/* Declare variables. */
10
CDKSCREEN *cdkscreen = 0;
11
CDKLABEL *stopSign = 0;
13
WINDOW *cursesWin = 0;
15
char *mesg[5], *sign[4];
19
cursesWin = initscr();
20
cdkscreen = initCDKScreen (cursesWin);
22
/* Start CDK Colors. */
25
/* Set the labels up. */
26
mesg[0] = "<C><#HL(40)>";
27
mesg[1] = "<C>Press </B/16>r<!B!16> for the </B/16>red light";
28
mesg[2] = "<C>Press </B/32>y<!B!32> for the </B/32>yellow light";
29
mesg[3] = "<C>Press </B/24>g<!B!24> for the </B/24>green light";
30
mesg[4] = "<C><#HL(40)>";
35
/* Declare the labels. */
36
title = newCDKLabel (cdkscreen, CENTER, TOP, mesg, 5, FALSE, FALSE);
37
stopSign = newCDKLabel (cdkscreen, CENTER, CENTER, sign, 3, TRUE, TRUE);
39
/* Do this until they hit q or escape. */
42
/* Draw the labels. */
43
drawCDKLabel (title, FALSE);
44
drawCDKLabel (stopSign, TRUE);
46
key = waitCDKLabel (stopSign, 0);
47
if (key == KEY_ESC || key == 'q' || key == 'Q')
51
else if (key == 'r' || key == 'R')
53
sign[0] = "</B/16> <#DI> ";
58
else if (key == 'y' || key == 'Y')
61
sign[1] = "</B/32> <#DI> ";
65
else if (key == 'g' || key == 'G')
69
sign[2] = "</B/24> <#DI> ";
73
/* Set the contents of the label and re-draw it. */
74
setCDKLabel (stopSign, sign, 3, TRUE);
78
destroyCDKLabel (title);
79
destroyCDKLabel (stopSign);
80
destroyCDKScreen (cdkscreen);