From bc7d95c628dc7ca05c4c50d7a54342e934da9380 Mon Sep 17 00:00:00 2001 From: PGNetHun Date: Wed, 7 Feb 2024 21:57:51 +0100 Subject: [PATCH] docs(micropython): update MicroPython examples in documentation (#5622) --- docs/get-started/quick-overview.rst | 12 ++++++------ docs/integration/bindings/micropython.rst | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/get-started/quick-overview.rst b/docs/get-started/quick-overview.rst index 3a82f5a4e..0e47c721c 100644 --- a/docs/get-started/quick-overview.rst +++ b/docs/get-started/quick-overview.rst @@ -352,14 +352,14 @@ Learn more about :ref:`micropython`. .. code:: python + # Initialize + import display_driver import lvgl as lv - # Create a Button and a Label + # Create a button with a label scr = lv.obj() - btn = lv.btn(scr) - btn.align(lv.screen_active(), lv.ALIGN.CENTER, 0, 0) + btn = lv.button(scr) + btn.align(lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) - label.set_text("Button") - - # Load the screen + label.set_text('Hello World!') lv.screen_load(scr) diff --git a/docs/integration/bindings/micropython.rst b/docs/integration/bindings/micropython.rst index 57d3a0787..a652556cd 100644 --- a/docs/integration/bindings/micropython.rst +++ b/docs/integration/bindings/micropython.rst @@ -81,10 +81,13 @@ A simple example .. code:: python + # Initialize + import display_driver import lvgl as lv - lv.init() + + # Create a button with a label scr = lv.obj() - btn = lv.btn(scr) + btn = lv.button(scr) btn.align(lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) label.set_text('Hello World!')