summaryrefslogtreecommitdiffstats
path: root/curs_lib.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-10-21 15:40:17 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-10-21 15:40:17 +0000
commite84c17069aad366dc9eb72ed344ceffeb3e84d3d (patch)
tree7ebf19205c0aff75ebc448ba07b2a1f6a1031b65 /curs_lib.c
parent735c8718c6608f708650465759b25df3759eab13 (diff)
Byrial Jensen's mutt_multi_choice() patch plus some German
translations.
Diffstat (limited to 'curs_lib.c')
-rw-r--r--curs_lib.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/curs_lib.c b/curs_lib.c
index bcf0a2a7..113a6ef9 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -378,3 +378,31 @@ void mutt_curs_set (int cursor)
curs_set (cursor);
}
#endif
+
+int mutt_multi_choice (char *prompt, char *letters)
+{
+ event_t ch;
+ int choice = 0;
+ char *p;
+
+ mvaddstr (LINES - 1, 0, prompt);
+ clrtoeol ();
+ while (!choice)
+ {
+ mutt_refresh ();
+ ch = mutt_getch ();
+ if (ch.ch == -1)
+ choice = -1;
+ else
+ {
+ p = strchr (letters, ch.ch);
+ if (p)
+ choice = p - letters + 1;
+ else
+ BEEP ();
+ }
+ }
+ CLEARLINE (LINES - 1);
+ mutt_refresh ();
+ return choice;
+}