btxld(8): Convert to hostprog.
[dragonfly.git] / contrib / dialog / help.c
blobea0fade3cd92f3b3be2e0c29f2341c8aaf05cb4a
1 /*
2 * $Id: help.c,v 1.3 2012/12/04 02:01:10 tom Exp $
4 * help.c -- implements the help dialog
6 * Copyright 2011,2012 Thomas E. Dickey
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.
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.
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.
24 #include <dialog.h>
27 * Display a help-file as a textbox widget.
29 int
30 dialog_helpfile(const char *title,
31 const char *file,
32 int height,
33 int width)
35 int result = DLG_EXIT_ERROR;
36 DIALOG_VARS save;
38 if (!dialog_vars.in_helpfile && file != 0 && *file != '\0') {
39 dlg_save_vars(&save);
41 dialog_vars.no_label = NULL;
42 dialog_vars.ok_label = NULL;
43 dialog_vars.help_button = FALSE;
44 dialog_vars.extra_button = FALSE;
45 dialog_vars.nook = FALSE;
47 dialog_vars.in_helpfile = TRUE;
49 result = dialog_textbox(title, file, height, width);
51 dlg_restore_vars(&save);
53 return (result);