App drawer
#4697
Replies: 1 comment
-
Check out this: From memory, I think this one might contain some code which helps you: In terms of your question, how to make a function fire when a button is clicked (I assume this is what you mean by on_change event), see the below, on_click: A basic example might look like this, for an on_click event. import flet as ft
def main(page: ft.Page):
def button_clicked(e):
result = add_numbers(1, 1)
result_textbox.value = str(result)
page.update()
def add_numbers(a, b):
return a + b
result_textbox = ft.TextField(label="Result")
calculate_button = ft.ElevatedButton(text="Calculate", on_click=button_clicked)
page.add(
calculate_button,
result_textbox,
)
ft.app(target=main) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am python beginner.
I am trying to create logout button on drawer.
What is the common logic ? How to make function to fires on_change event ?
Please give some example code
Beta Was this translation helpful? Give feedback.
All reactions