1
0
Fork 0

- [TUI] refactored quitting dialog test code in a function.

This commit is contained in:
cage 2024-03-02 16:23:05 +01:00
parent 6472ede4b0
commit 8deb702090
1 changed files with 5 additions and 2 deletions

View File

@ -497,6 +497,10 @@ this exact quantity would go beyond the length or rows or zero."
(declare (ignore redraw))
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
&optional (title (_ "Information")))
"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)
(loop named inner
for c = (tui:decode-key-event (c:get-wide-event low-level-window))
while (and (string/= c "q")
(string/= c "^G"))
while (not (event-quit-blocking-list-dialog-window-p c))
do
(cond
((string= c :key-arrow-up)