Skip to content

Instantly share code, notes, and snippets.

@stepansnigirev
Last active November 25, 2019 17:36
Show Gist options
  • Save stepansnigirev/87032c693fd12eeb9dfd219535630691 to your computer and use it in GitHub Desktop.
Save stepansnigirev/87032c693fd12eeb9dfd219535630691 to your computer and use it in GitHub Desktop.
Local files lv_editor demo
THE WTF PUBLIC LICENSE
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
# Create a page
page = lv.page(lv.scr_act())
page.set_size(150, 200)
page.align(None, lv.ALIGN.CENTER, 0, 0)
with open("license.txt") as f:
txt = f.read()
# Create a label on the page
label = lv.label(page)
label.set_long_mode(lv.label.LONG.BREAK) # Automatically break long lines
label.set_width(page.get_fit_width()) # Set the label width to max value to not show hor. scroll bars
label.set_text(txt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment