当前位置:网站首页>Flet tutorial 06 basic introduction to textbutton (tutorial includes source code)

Flet tutorial 06 basic introduction to textbutton (tutorial includes source code)

2022-07-04 20:42:00 Knowledge fatness

What is? TextButton

The text button is used for the operation with the lowest priority , Especially when rendering multiple options . Text buttons can be placed on various backgrounds . Before interacting with the button , Its container is invisible .

Combat code

 Insert picture description here

import flet
from flet import Page, TextButton


def main(page: Page):
    page.title = "Basic text buttons"
    page.add(
        TextButton(text="Text button"),
        TextButton("Disabled button", disabled=True),
    )


flet.app(target=main)

With Icon button

 Insert picture description here

import flet
from flet import Page, TextButton


def main(page: Page):
    page.title = "Text buttons with icons"
    page.add(
        TextButton("Button with icon", icon="chair_outlined"),
        TextButton(
            "Button
原网站

版权声明
本文为[Knowledge fatness]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041848591309.html