1224012Snwhitehorn/* 2224012Snwhitehorn * $Id: help.c,v 1.2 2011/06/25 00:27:16 tom Exp $ 3224012Snwhitehorn * 4224012Snwhitehorn * help.c -- implements the help dialog 5224012Snwhitehorn * 6224012Snwhitehorn * Copyright 2011 Thomas E. Dickey 7224012Snwhitehorn * 8224012Snwhitehorn * This program is free software; you can redistribute it and/or modify 9224012Snwhitehorn * it under the terms of the GNU Lesser General Public License, version 2.1 10224012Snwhitehorn * as published by the Free Software Foundation. 11224012Snwhitehorn * 12224012Snwhitehorn * This program is distributed in the hope that it will be useful, but 13224012Snwhitehorn * WITHOUT ANY WARRANTY; without even the implied warranty of 14224012Snwhitehorn * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15224012Snwhitehorn * Lesser General Public License for more details. 16224012Snwhitehorn * 17224012Snwhitehorn * You should have received a copy of the GNU Lesser General Public 18224012Snwhitehorn * License along with this program; if not, write to 19224012Snwhitehorn * Free Software Foundation, Inc. 20224012Snwhitehorn * 51 Franklin St., Fifth Floor 21224012Snwhitehorn * Boston, MA 02110, USA. 22224012Snwhitehorn */ 23224012Snwhitehorn 24224012Snwhitehorn#include <dialog.h> 25224012Snwhitehorn 26224012Snwhitehorn/* 27224012Snwhitehorn * Display a help-file as a textbox widget. 28224012Snwhitehorn */ 29224012Snwhitehornint 30224012Snwhitehorndialog_helpfile(const char *title, 31224012Snwhitehorn const char *file, 32224012Snwhitehorn int height, 33224012Snwhitehorn int width) 34224012Snwhitehorn{ 35224012Snwhitehorn int result = DLG_EXIT_ERROR; 36224012Snwhitehorn 37224012Snwhitehorn if (!dialog_vars.in_helpfile && file != 0 && *file != '\0') { 38224012Snwhitehorn dialog_vars.in_helpfile = TRUE; 39224012Snwhitehorn result = dialog_textbox(title, file, height, width); 40224012Snwhitehorn dialog_vars.in_helpfile = FALSE; 41224012Snwhitehorn } 42224012Snwhitehorn return (result); 43224012Snwhitehorn} 44