Merge pull request #33 from rfschmid/okay-dialog-improvements

This commit is contained in:
pdxlocations
2025-01-17 11:41:21 -08:00
committed by GitHub
+3 -2
View File
@@ -25,7 +25,7 @@ def dialog(stdscr, title, message):
win.addstr(2 + i, 2, l)
# Add button
win.addstr(dialog_height - 2, (dialog_width - 4) // 2, " Ok ")
win.addstr(dialog_height - 2, (dialog_width - 4) // 2, " Ok ", curses.color_pair(3))
# Refresh dialog window
win.refresh()
@@ -33,7 +33,8 @@ def dialog(stdscr, title, message):
# Get user input
while True:
char = win.getch()
if char == curses.KEY_ENTER or char == 10 or char == 13:
# Close dialog with enter, space, or esc
if char in(curses.KEY_ENTER, 10, 13, 32, 27):
win.clear()
win.refresh()
return