当前位置:网站首页>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)
边栏推荐
- 漫谈客户端存储技术之Cookie篇
- In operation (i.e. included in) usage of SSRs filter
- Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
- Regular replacement [JS, regular expression]
- 1009 product of polynomials (25 points) (PAT class a)
- Is it safe for Great Wall Securities to open an account? Stock account opening process online account opening
- 精选综述 | 用于白内障分级/分类的机器学习技术
- Kotlin inheritance
- Creation of JVM family objects
- Qt编写物联网管理平台38-多种数据库支持
猜你喜欢
B2B mall system development of electronic components: an example of enabling enterprises to build standardized purchase, sale and inventory processes
What is the application technology of neural network and Internet of things
做社交媒体营销应该注意些什么?Shopline卖家的成功秘笈在这里!
Write it down once Net analysis of thread burst height of an industrial control data acquisition platform
Decryption function calculates "task state and lifecycle management" of asynchronous task capability
How is the entered query SQL statement executed?
Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines
Selected review | machine learning technology for Cataract Classification / classification
Multi table operation - external connection query
实战模拟│JWT 登录认证
随机推荐
How is the entered query SQL statement executed?
Small hair cat Internet of things platform construction and application model
PHP pseudo original API docking method
Lingyun going to sea | Wenhua online & Huawei cloud: creating a new solution for smart teaching in Africa
Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
C server log module
太方便了,钉钉上就可完成代码发布审批啦!
解密函数计算异步任务能力之「任务的状态及生命周期管理」
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
Why is the maximum speed the speed of light
C language - Introduction - Foundation - grammar - process control (VII)
MySQL中的日期时间类型与格式化方式
What are the consequences of closing the read / write channel?
SSRS筛选器的IN运算(即包含于)用法
[problem] Druid reports exception SQL injection violation, part always true condition not allow solution
凌云出海记 | 沐融科技&华为云:打造非洲金融SaaS解决方案样板
AP8022开关电源小家电ACDC芯片离线式开关电源IC
Neural network IOT platform construction (IOT platform construction practical tutorial)
Huawei Nova 10 series supports the application security detection function to build a strong mobile security firewall
1009 product of polynomials (25 points) (PAT class a)