当前位置:网站首页>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)
边栏推荐
- Neural network IOT platform construction (IOT platform construction practical tutorial)
- In operation (i.e. included in) usage of SSRs filter
- 太方便了,钉钉上就可完成代码发布审批啦!
- 凌云出海记 | 沐融科技&华为云:打造非洲金融SaaS解决方案样板
- 华为nova 10系列支持应用安全检测功能 筑牢手机安全防火墙
- Anhui Zhong'an online culture and tourism channel launched a series of financial media products of "follow the small editor to visit Anhui"
- 应用实践 | 蜀海供应链基于 Apache Doris 的数据中台建设
- Cbcgpprogressdlg progress bar used by BCG
- Regular replacement [JS, regular expression]
- FS4061A升压8.4V充电IC芯片和FS4061B升压12.6V充电IC芯片规格书datasheet
猜你喜欢
How to adapt your games to different sizes of mobile screen
Qt编写物联网管理平台38-多种数据库支持
【深度学习】一文看尽Pytorch之十九种损失函数
Small hair cat Internet of things platform construction and application model
C # use stopwatch to measure the running time of the program
ICML 2022 | meta proposes a robust multi-objective Bayesian optimization method to effectively deal with input noise
Creation of JVM family objects
华为nova 10系列支持应用安全检测功能 筑牢手机安全防火墙
Introduction to ACM combination counting
[Beijing Xunwei] i.mx6ull development board porting Debian file system
随机推荐
上线首月,这家露营地游客好评率高达99.9%!他是怎么做到的?
实践示例理解js强缓存协商缓存
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
HMM hidden Markov model and code implementation
Pytoch learning (4)
栈:如何实现有效括号的判断?
同事的接口文档我每次看着就头大,毛病多多。。。
Lingyun going to sea | Wenhua online & Huawei cloud: creating a new solution for smart teaching in Africa
How is the entered query SQL statement executed?
更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
Anhui Zhong'an online culture and tourism channel launched a series of financial media products of "follow the small editor to visit Anhui"
New wizard effect used by BCG
node强缓存和协商缓存实战示例
Huawei cloud store homepage banner resource bit application
精选综述 | 用于白内障分级/分类的机器学习技术
复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算
Every time I look at the interface documents of my colleagues, I get confused and have a lot of problems...
2022 version of stronger jsonpath compatibility and performance test (snack3, fastjson2, jayway.jsonpath)
解密函数计算异步任务能力之「任务的状态及生命周期管理」
Six stones programming: about code, there are six triumphs