Merge pull request #86 from tomsci/tomsci-load-flicker

Disable redraw while populating prompt_option list
sammachin-gprs
Marek Ventur 2018-09-02 14:12:52 +01:00 committed by GitHub
commit 0eaf8e34e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -146,12 +146,14 @@ def prompt_option(options, index=0, text = None, title=None, select_text="OK", n
window.text(5, 10, text, ugfx.BLACK)
options_list = ugfx.List(5, list_y, ugfx.width() - 25, 260 - list_y, parent = window)
options_list.disable_draw()
for option in options:
if isinstance(option, dict) and option["title"]:
options_list.add_item(option["title"])
else:
options_list.add_item(str(option))
options_list.enable_draw()
options_list.selected_index(index)
select_text = "A: " + select_text