当前位置:网站首页>Flet tutorial 05 outlinedbutton basic introduction (tutorial includes source code)
Flet tutorial 05 outlinedbutton basic introduction (tutorial includes source code)
2022-07-04 20:32:00 【Knowledge fatness】
What is? OutlinedButton
The outline button is a medium emphasis button . They contain important operations , But not the main operation in the application . The outline button is well matched with the fill button , Secondary operation replaced by indication .
Combat code

import flet
from flet import OutlinedButton, Page
def main(page: Page):
page.title = "Basic outlined buttons"
page.add(
OutlinedButton(text="Outlined button"),
OutlinedButton("Disabled button", disabled=True),
)
flet.app(target=main)
With graph button

import flet
from flet import OutlinedButton, Page
def main(page: Page):
page.title = "Outlined buttons with icons"
page.add(
OutlinedButton("Button with icon", icon="chair_outlined"),
OutlinedButton(
"Button with colorful icon",
icon="park_rounded",
icon_color="green400",
),
)
flet.app(target=main)
Response Click

import flet
from flet import OutlinedButton, Page, Text
def main(page: Page):
page.title = "Outlined button with 'click' event"
def button_clicked(e):
b.data += 1
t.value = f"Button clicked {b.data} time(s)"
page.update()
b = OutlinedButton("Button with 'click' event", on_click=button_clicked, data=0)
t = Text()
page.add(b, t)
flet.app(target=main)
Custom buttons

import flet
from flet import (
Column,
Container,
Icon,
OutlinedButton,
Page,
Row,
Text,
icons,
padding,
)
def main(page: Page):
page.title = "Outlined buttons with custom content"
page.add(
OutlinedButton(
width=150,
content=Row(
[
Icon(name=icons.FAVORITE, color="pink"),
Icon(name=icons.AUDIOTRACK, color="green"),
Icon(name=icons.BEACH_ACCESS, color="blue"),
],
alignment="spaceAround",
),
),
OutlinedButton(
content=Container(
content=Column(
[
Text(value="Compound button", size=20),
Text(value="This is secondary text"),
],
alignment="center",
spacing=5,
),
padding=padding.all(10),
),
),
)
flet.app(target=main)
边栏推荐
- Employment prospects of neural network Internet of things application technology [welcome to add]
- Kotlin classes and objects
- Six stones programming: about code, there are six triumphs
- [problem] Druid reports exception SQL injection violation, part always true condition not allow solution
- C语言-入门-基础-语法-流程控制(七)
- 2022 version of stronger jsonpath compatibility and performance test (snack3, fastjson2, jayway.jsonpath)
- 输入的查询SQL语句,是如何执行的?
- In operation (i.e. included in) usage of SSRs filter
- 紫光展锐完成全球首个 5G R17 IoT NTN 卫星物联网上星实测
- 【毕业季】绿蚁新醅酒,红泥小火炉。晚来天欲雪,能饮一杯无?
猜你喜欢

Cbcgpprogressdlg progress bar used by BCG

针对深度学习的“失忆症”,科学家提出基于相似性加权交错学习,登上PNAS

In operation (i.e. included in) usage of SSRs filter

HMM hidden Markov model and code implementation

原来这才是 BGP 协议

Neural network IOT platform construction (IOT platform construction practical tutorial)

Dark horse programmer - software testing - stage 08 2-linux and database-23-30-process port related, modify file permissions, obtain port number information, program and process related operations, Li

C # use stopwatch to measure the running time of the program

Detailed explanation of Audi EDI invoice message

What is the application technology of neural network and Internet of things
随机推荐
【历史上的今天】7 月 4 日:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生
Oracle database, numbers Force 2 decimal places to display-Alibaba Cloud
哈希(Hash)竞猜游戏系统开发功能分析及源码
[QNX hypervisor 2.2 user manual]6.3.1 factory page and control page
漫谈客户端存储技术之Cookie篇
Process of manually encrypt the mass-producing firmware and programming ESP devices
NLP、视觉、芯片...AI重点方向发展几何?青源会展望报告发布[附下载]
Integritee通过XCM集成至Moonriver,为其生态系统带来企业级隐私解决方案
So this is the BGP agreement
New wizard effect used by BCG
【毕业季】绿蚁新醅酒,红泥小火炉。晚来天欲雪,能饮一杯无?
Anhui Zhong'an online culture and tourism channel launched a series of financial media products of "follow the small editor to visit Anhui"
C语言-入门-基础-语法-流程控制(七)
Employment prospects of neural network Internet of things application technology [welcome to add]
What are the consequences of closing the read / write channel?
Every time I look at the interface documents of my colleagues, I get confused and have a lot of problems...
Dynamic memory management
实战模拟│JWT 登录认证
Dark horse programmer - software testing - 09 stage 2-linux and database -31-43 instructions issued by modifying the file permission letter, - find the link to modify the file, find the file command,
Kotlin cycle control