mirror of https://codeberg.org/cage/tinmop/
- [TUI] refactored quitting dialog test code in a function.
This commit is contained in:
parent
6472ede4b0
commit
8deb702090
|
@ -497,6 +497,10 @@ this exact quantity would go beyond the length or rows or zero."
|
||||||
(declare (ignore redraw))
|
(declare (ignore redraw))
|
||||||
t)
|
t)
|
||||||
|
|
||||||
|
(defun event-quit-blocking-list-dialog-window-p (event)
|
||||||
|
(or (string= event "q")
|
||||||
|
(string= event "^G")))
|
||||||
|
|
||||||
(defun make-blocking-list-dialog-window (screen all-fields text-lines callback
|
(defun make-blocking-list-dialog-window (screen all-fields text-lines callback
|
||||||
&optional (title (_ "Information")))
|
&optional (title (_ "Information")))
|
||||||
"Draw a window with a scrollable list of entries, pressing enter
|
"Draw a window with a scrollable list of entries, pressing enter
|
||||||
|
@ -548,8 +552,7 @@ will fire the `callback' function (with the selected field from `all-fields'
|
||||||
(draw)
|
(draw)
|
||||||
(loop named inner
|
(loop named inner
|
||||||
for c = (tui:decode-key-event (c:get-wide-event low-level-window))
|
for c = (tui:decode-key-event (c:get-wide-event low-level-window))
|
||||||
while (and (string/= c "q")
|
while (not (event-quit-blocking-list-dialog-window-p c))
|
||||||
(string/= c "^G"))
|
|
||||||
do
|
do
|
||||||
(cond
|
(cond
|
||||||
((string= c :key-arrow-up)
|
((string= c :key-arrow-up)
|
||||||
|
|
Loading…
Reference in New Issue