xref: /freebsd/contrib/dialog/help.c (revision c6ec7d31830ab1c80edae95ad5e4b9dba10c47ac)
1 /*
2  *  $Id: help.c,v 1.2 2011/06/25 00:27:16 tom Exp $
3  *
4  *  help.c -- implements the help dialog
5  *
6  *  Copyright 2011	Thomas E. Dickey
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU Lesser General Public License, version 2.1
10  *  as published by the Free Software Foundation.
11  *
12  *  This program is distributed in the hope that it will be useful, but
13  *  WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  *  Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public
18  *  License along with this program; if not, write to
19  *	Free Software Foundation, Inc.
20  *	51 Franklin St., Fifth Floor
21  *	Boston, MA 02110, USA.
22  */
23 
24 #include <dialog.h>
25 
26 /*
27  * Display a help-file as a textbox widget.
28  */
29 int
30 dialog_helpfile(const char *title,
31 		const char *file,
32 		int height,
33 		int width)
34 {
35     int result = DLG_EXIT_ERROR;
36 
37     if (!dialog_vars.in_helpfile && file != 0 && *file != '\0') {
38 	dialog_vars.in_helpfile = TRUE;
39 	result = dialog_textbox(title, file, height, width);
40 	dialog_vars.in_helpfile = FALSE;
41     }
42     return (result);
43 }
44