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

« back to all changes in this revision

Viewing changes to examples/viewer_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: viewer_ex.c,v 1.16 2005/04/24 17:53:03 tom Exp $ */
 
1
/* $Id: viewer_ex.c,v 1.19 2005/12/30 09:48:32 tom Exp $ */
2
2
 
3
 
#include <cdk.h>
 
3
#include <cdk_test.h>
4
4
 
5
5
#ifdef HAVE_XCURSES
6
 
char *XCursesProgramName="viewer_ex";
 
6
char *XCursesProgramName = "viewer_ex";
7
7
#endif
8
8
 
9
9
/*
60
60
                               "</5>", "</48>", "</N>", "</N>",
61
61
                               CDKparamValue(&params, 'N', TRUE),
62
62
                               CDKparamValue(&params, 'S', FALSE));
 
63
      if (fSelect == 0)
 
64
      {
 
65
         destroyCDKScreen (cdkscreen);
 
66
         endCDK();
 
67
 
 
68
         fprintf(stderr, "Cannot create fselect-widget\n");
 
69
         ExitProgram (EXIT_FAILURE);
 
70
      }
63
71
 
64
72
      /*
65
73
       * Set the starting directory. This is not necessary because when
84
92
         destroyCDKFselect (fSelect);
85
93
         destroyCDKScreen (cdkscreen);
86
94
         endCDK();
87
 
         exit (EXIT_SUCCESS);
 
95
         ExitProgram (EXIT_SUCCESS);
88
96
      }
89
97
   }
90
98
 
108
116
 
109
117
      /* Print out a message and exit. */
110
118
      printf ("Oops. Can't seem to create viewer. Is the window too small?\n");
111
 
      exit (EXIT_SUCCESS);
 
119
      ExitProgram (EXIT_SUCCESS);
112
120
   }
113
121
 
114
122
   if (link_it)
128
136
      {
129
137
         endCDK();
130
138
         printf ("Could not open \"%s\"\n", filename);
131
 
         exit (EXIT_FAILURE);
 
139
         ExitProgram (EXIT_FAILURE);
132
140
      }
133
141
   }
134
142
 
136
144
   sprintf (vTitle, "<C></B/21>Filename:<!21></22>%20s<!22!B>", filename);
137
145
   setCDKViewer (example, vTitle, info, lines, A_REVERSE, interp_it, TRUE, TRUE);
138
146
 
 
147
   CDKfreeStrings (info);
 
148
 
139
149
   /* Destroy the file selector widget. */
140
150
   destroyCDKFselect (fSelect);
141
151
 
153
163
   else if (example->exitType == vNORMAL)
154
164
   {
155
165
      sprintf (temp, "<C>You selected button %d", selected);
156
 
      mesg[0] = copyChar (temp);
 
166
      mesg[0] = temp;
157
167
      mesg[1] = "";
158
168
      mesg[2] = "<C>Press any key to continue.";
159
169
      popupLabel (cdkscreen, mesg, 3);
163
173
   destroyCDKViewer (example);
164
174
   destroyCDKScreen (cdkscreen);
165
175
   endCDK();
166
 
   exit (EXIT_SUCCESS);
 
176
   ExitProgram (EXIT_SUCCESS);
167
177
}