~ubuntu-branches/ubuntu/trusty/libcdk5/trusty

« back to all changes in this revision

Viewing changes to examples/buttonbox_ex.c

  • Committer: Bazaar Package Importer
  • Author(s): John Goerzen
  • Date: 2007-06-06 03:54:31 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070606035431-ba4gdvw0h6ybffsu
Tags: 5.0.20060507-1
* New upstream release.
* Fixed header patching.  Patch from Robert Schiele.
  Closes: #402978, #416336.
* Update widget count in description.  Closes: #294709.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: buttonbox_ex.c,v 1.16 2004/08/28 00:53:46 tom Exp $ */
 
1
/* $Id: buttonbox_ex.c,v 1.18 2005/12/30 09:50:48 tom Exp $ */
2
2
 
3
 
#include <cdk.h>
 
3
#include <cdk_test.h>
4
4
 
5
5
#ifdef HAVE_XCURSES
6
6
char *XCursesProgramName = "buttonbox_ex";
33
33
   entry = newCDKEntry (cdkscreen, CENTER, CENTER,
34
34
                        "<C>Enter a name", "Name ", A_NORMAL, '.', vMIXED,
35
35
                        40, 0, 256, TRUE, FALSE);
 
36
   if (entry == 0)
 
37
   {
 
38
      destroyCDKScreen (cdkscreen);
 
39
      endCDK();
 
40
 
 
41
      fprintf(stderr, "Cannot create entry-widget\n");
 
42
      ExitProgram (EXIT_FAILURE);
 
43
   }
 
44
 
36
45
 
37
46
   /* Create the button box widget. */
38
47
   buttonWidget = newCDKButtonbox (cdkscreen,
42
51
                                   0, 1, 2,
43
52
                                   buttons, 2, A_REVERSE,
44
53
                                   TRUE, FALSE);
 
54
   if (buttonWidget == 0)
 
55
   {
 
56
      destroyCDKScreen (cdkscreen);
 
57
      endCDK();
 
58
 
 
59
      fprintf(stderr, "Cannot create buttonbox-widget\n");
 
60
      ExitProgram (EXIT_FAILURE);
 
61
   }
45
62
 
46
63
   /* Set the lower left and right characters of the box. */
47
64
   setCDKEntryLLChar (entry, ACS_LTEE);
72
89
           buttons[selection]);
73
90
 
74
91
   freeChar (info);
75
 
   exit (EXIT_SUCCESS);
 
92
   ExitProgram (EXIT_SUCCESS);
76
93
}
77
94
 
78
95
static int entryCB (EObjectType cdktype GCC_UNUSED,