File: view_info.c

package info (click to toggle)
libcdk5 5.0.20161210-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,440 kB
  • ctags: 2,833
  • sloc: ansic: 32,375; sh: 4,732; makefile: 1,122; sed: 43; cpp: 41
file content (44 lines) | stat: -rw-r--r-- 1,033 bytes parent folder | download | duplicates (2)
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
#include <cdk_int.h>

/*
 * $Author: tom $
 * $Date: 2016/11/20 18:35:56 $
 * $Revision: 1.3 $
 */

/*
 * This allows the user to view information.
 */
int viewInfo (CDKSCREEN *screen,
	      const char *title,
	      CDK_CSTRING2 info,
	      int count,
	      CDK_CSTRING2 buttons,
	      int buttonCount,
	      boolean interpret)
{
   CDKVIEWER *viewer = 0;
   int selected;

   /* Create the file viewer to view the file selected. */
   viewer = newCDKViewer (screen, CENTER, CENTER, -6, -16,
			  buttons, buttonCount,
			  A_REVERSE, TRUE, TRUE);

   /* Set up the viewer title, and the contents to the widget. */
   setCDKViewer (viewer, title, info, count, A_REVERSE, interpret, TRUE, TRUE);

   /* Activate the viewer widget. */
   selected = activateCDKViewer (viewer, 0);

   /* Make sure they exited normally. */
   if (viewer->exitType != vNORMAL)
   {
      destroyCDKViewer (viewer);
      return (-1);
   }

   /* Clean up and return the button index selected. */
   destroyCDKViewer (viewer);
   return selected;
}