浏览代码

Slightly simpler. (#1933)

Fabien Lelaquais 7 月之前
父节点
当前提交
6818a2d62b
共有 2 个文件被更改,包括 2 次插入11 次删除
  1. 1 1
      doc/gui/examples/controls/button_icon.py
  2. 1 10
      doc/gui/examples/controls/button_simple.py

+ 1 - 1
doc/gui/examples/controls/button_icon.py

@@ -15,7 +15,7 @@
 # -----------------------------------------------------------------------------------------
 from taipy.gui import Gui, Icon
 
-icon = Icon("./charles-avatar.png", "charles")
+icon = Icon("charles-avatar.png", "Charles")
 
 page = """
 <|{icon}|button|>

+ 1 - 10
doc/gui/examples/controls/button_simple.py

@@ -15,16 +15,7 @@
 # -----------------------------------------------------------------------------------------
 from taipy.gui import Gui
 
-text = None
-
-def on_action(state, id: str, payload: dict):
-    # React to the button press action.
-    state.text = f"The button '{id}' was pressed and called action '{payload.get('action')}'."
-
-page = """
-<|Button Label|button|>
-<|{text}|>
-"""
+page = "<|Button Label|button|>"
 
 if __name__ == "__main__":
     Gui(page).run(title="Button - Simple")