From 5a4f7374c689195a6c5450e70114c40e268d465f Mon Sep 17 00:00:00 2001 From: Mazet Laurent Date: Fri, 10 May 2024 23:03:56 +0200 Subject: [PATCH] about window --- cmore.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/cmore.c b/cmore.c index 33fb276..7d19206 100644 --- a/cmore.c +++ b/cmore.c @@ -149,6 +149,25 @@ void process (void) } } +void about (void) +{ + int xmax, ymax; + WINDOW *wbody = bodywin (); + getmaxyx (stdscr, ymax, xmax); + + wmove (stdscr, ymax / 4, xmax / 4); + WINDOW *whelp = winputbox (stdscr, ymax / 2, xmax / 2); + + wmove (whelp, 1, 1); + waddstr (whelp, "CMore: a curses more\nThis program is a pager with a text user interface.\nTo move displayed text or in menu, use arrow keys or vim keys (i, j, k, l).\nTo access menus, use Alt-f of Alt-h.\nTo quit displayed text, press Escape or 'q'."); + wrefresh (whelp); + + waitforkey (); + + delwin (whelp); + wrefresh (wbody); +} + menu SubMenu0[] = { { "Refresh", process, "Refresh action"}, @@ -163,7 +182,7 @@ void sub0 (void) menu SubMenu1[] = { - { "About", DoExit, "About..." }, + { "About", about, "About..." }, { "", (FUNC)0, "" } }; -- 2.30.2