Disable redraw while populating prompt_option list

Reduces flicker in launcher app
sammachin-gprs
Tom Sutcliffe 2018-09-02 13:56:25 +01:00
parent 2aeb0434da
commit 956ac9232d
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