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 57 58 59 60 61
|
/* $Id: hello_ex.c,v 1.12 2016/12/04 15:22:16 tom Exp $ */
#include <cdk_test.h>
#ifdef HAVE_XCURSES
char *XCursesProgramName = "hello_ex";
#endif
int main (int argc, char **argv)
{
CDKSCREEN *cdkscreen;
CDKLABEL *demo;
const char *mesg[4];
CDK_PARAMS params;
CDKparseParams (argc, argv, ¶ms, CDK_MIN_PARAMS);
cdkscreen = initCDKScreen (NULL);
/* Start CDK Colors. */
initCDKColor ();
/* Set the labels up. */
mesg[0] = "</5><#UL><#HL(30)><#UR>";
mesg[1] = "</5><#VL(10)>Hello World!<#VL(10)>";
mesg[2] = "</5><#LL><#HL(30)><#LR>";
/* Declare the labels. */
demo = newCDKLabel (cdkscreen,
CDKparamValue (¶ms, 'X', CENTER),
CDKparamValue (¶ms, 'Y', CENTER),
(CDK_CSTRING2) mesg, 3,
CDKparamValue (¶ms, 'N', TRUE),
CDKparamValue (¶ms, 'S', TRUE));
/* Is the label null? */
if (demo == 0)
{
/* Clean up the memory. */
destroyCDKScreen (cdkscreen);
/* End curses... */
endCDK ();
printf ("Cannot create the label. Is the window too small?\n");
ExitProgram (EXIT_FAILURE);
}
setCDKLabelBackgroundAttrib (demo, COLOR_PAIR (2));
/* Draw the CDK screen. */
refreshCDKScreen (cdkscreen);
waitCDKLabel (demo, ' ');
/* Clean up. */
destroyCDKLabel (demo);
destroyCDKScreen (cdkscreen);
endCDK ();
ExitProgram (EXIT_SUCCESS);
}
|