fix(examples) join usage (#2425)

Use 'join' correctly on Python scripts
This commit is contained in:
Amir Gonnen
2021-08-02 12:56:44 +03:00
committed by GitHub
parent 65415d3f68
commit 4bdeb756da
3 changed files with 21 additions and 21 deletions

View File

@@ -10,16 +10,16 @@ def event_handler(e):
# Create a normal drop down list # Create a normal drop down list
dd = lv.dropdown(lv.scr_act()) dd = lv.dropdown(lv.scr_act())
dd.set_options("\n".join([ dd.set_options("\n".join([
"Apple\n" "Apple",
"Banana\n" "Banana",
"Orange\n" "Orange",
"Cherry\n" "Cherry",
"Grape\n" "Grape",
"Raspberry\n" "Raspberry",
"Melon\n" "Melon",
"Orange\n" "Orange",
"Lemon\n" "Lemon",
"Nuts\n"])) "Nuts"]))
dd.align(lv.ALIGN.TOP_MID, 0, 20) dd.align(lv.ALIGN.TOP_MID, 0, 20)
dd.add_event_cb(event_handler, lv.EVENT.ALL, None) dd.add_event_cb(event_handler, lv.EVENT.ALL, None)

View File

@@ -3,11 +3,11 @@
# #
opts = "\n".join([ opts = "\n".join([
"Apple\n" "Apple",
"Banana\n" "Banana",
"Orange\n" "Orange",
"Melon\n" "Melon",
"Grape\n" "Grape",
"Raspberry"]) "Raspberry"])
dd = lv.dropdown(lv.scr_act()) dd = lv.dropdown(lv.scr_act())

View File

@@ -30,12 +30,12 @@ def event_cb(e):
# Create a drop down list # Create a drop down list
dropdown = lv.dropdown(lv.scr_act()) dropdown = lv.dropdown(lv.scr_act())
dropdown.align(lv.ALIGN.TOP_LEFT, 10, 10) dropdown.align(lv.ALIGN.TOP_LEFT, 10, 10)
dropdown.set_options("".join([ dropdown.set_options("\n".join([
"New project\n", "New project",
"New file\n", "New file",
"Open project\n", "Open project",
"Recent projects\n", "Recent projects",
"Preferences\n", "Preferences",
"Exit"])) "Exit"]))
# Set a fixed text to display on the button of the drop-down list # Set a fixed text to display on the button of the drop-down list