blob: 0eeada73ad3db783fc67397c610bff76dd752c7b (
plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#include <cdk.h>
#ifdef HAVE_XCURSES
char *XCursesProgramName="hello_ex";
#endif
int main (void)
{
/* Declare variables. */
CDKSCREEN *cdkscreen;
CDKLABEL *demo;
WINDOW *cursesWin;
char *mesg[5];
/* Set up CDK. */
cursesWin = initscr();
cdkscreen = initCDKScreen (cursesWin);
/* Start CDK Colors. */
initCDKColor();
/* Set the labels up. */
mesg[0] = " ";
mesg[1] = "<C>Hello World!";
mesg[2] = "<R>Hello World!";
mesg[3] = "<L>Hello World!";
mesg[4] = " ";
/* Declare the labels. */
demo = newCDKLabel (cdkscreen, CENTER, CENTER, mesg, 5, TRUE, TRUE);
/* Is the label null? */
if (demo == 0)
{
/* Clean up the memory. */
destroyCDKScreen (cdkscreen);
/* End curses... */
endCDK();
/* Spit out a message. */
printf ("Oops. Can't seem to create the label. Is the window too small?\n");
exit (1);
}
/* Draw the CDK screen. */
refreshCDKScreen (cdkscreen);
waitCDKLabel (demo, ' ');
/* Clean up. */
destroyCDKLabel (demo);
destroyCDKScreen (cdkscreen);
delwin (cursesWin);
endCDK();
exit (0);
}
|