当前位置:网站首页>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)
边栏推荐
- Kotlin condition control
- Chrome开发工具:VMxxx文件是什么鬼
- 输入的查询SQL语句,是如何执行的?
- 实战模拟│JWT 登录认证
- NetCore3.1 Json web token 中间件
- Creation of JVM family objects
- Thinking on demand development
- Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
- ACM组合计数入门
- Lingyun going to sea | Wenhua online & Huawei cloud: creating a new solution for smart teaching in Africa
猜你喜欢
做社交媒体营销应该注意些什么?Shopline卖家的成功秘笈在这里!
TCP waves twice, have you seen it? What about four handshakes?
FS8B711S14电动红酒开瓶器单片机IC方案开发专用集成IC
MySQL中的日期时间类型与格式化方式
NLP、视觉、芯片...AI重点方向发展几何?青源会展望报告发布[附下载]
[problem] Druid reports exception SQL injection violation, part always true condition not allow solution
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
Key rendering paths for performance optimization
#夏日挑战赛#带你玩转HarmonyOS多端钢琴演奏
随机推荐
Offset function and windowing function
Huawei Nova 10 series supports the application security detection function to build a strong mobile security firewall
YOLOv5s-ShuffleNetV2
应用实践 | 蜀海供应链基于 Apache Doris 的数据中台建设
[in-depth learning] review pytoch's 19 loss functions
AP8022开关电源小家电ACDC芯片离线式开关电源IC
Detailed explanation of Audi EDI invoice message
精选综述 | 用于白内障分级/分类的机器学习技术
Lingyun going to sea | Wenhua online & Huawei cloud: creating a new solution for smart teaching in Africa
为什么最大速度是光速
#夏日挑战赛#带你玩转HarmonyOS多端钢琴演奏
c# . Net MVC uses Baidu ueditor rich text box to upload files (pictures, videos, etc.)
Development and construction of DFI ecological NFT mobile mining system
Optimize if code with policy mode [policy mode]
Pointnext: review pointnet through improved model training and scaling strategies++
复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算
Multi table operation inner join query
Is it necessary to apply for code signing certificate for software client digital signature?
node强缓存和协商缓存实战示例
实战模拟│JWT 登录认证