about window
authorMazet Laurent <mazet@softndesign.org>
Fri, 10 May 2024 21:03:56 +0000 (23:03 +0200)
committerMazet Laurent <mazet@softndesign.org>
Fri, 10 May 2024 21:03:56 +0000 (23:03 +0200)
cmore.c

diff --git a/cmore.c b/cmore.c
index 33fb2768ffc341845a9af5f9eb5a91a68a0e7dc9..7d19206471ccac70534e7938efd8e9f8ef77af56 100644 (file)
--- 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, "" }
 };