当前位置:网站首页>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)
边栏推荐
- Creation of JVM family objects
- On communication bus arbitration mechanism and network flow control from the perspective of real-time application
- Template_ Judging prime_ Square root / six prime method
- Pointnext: review pointnet through improved model training and scaling strategies++
- B2B mall system development of electronic components: an example of enabling enterprises to build standardized purchase, sale and inventory processes
- 九齐单片机NY8B062D单按键控制4种LED状态
- HMM hidden Markov model and code implementation
- 1500万员工轻松管理,云原生数据库GaussDB让HR办公更高效
- 凌云出海记 | 文华在线&华为云:打造非洲智慧教学新方案
- Optimize if code with policy mode [policy mode]
猜你喜欢

ACM组合计数入门

Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines

同事的接口文档我每次看着就头大,毛病多多。。。

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

Creation of JVM family objects

In the first month of its launch, the tourist praise rate of this campsite was as high as 99.9%! How did he do it?

Huawei Nova 10 series supports the application security detection function to build a strong mobile security firewall

实战模拟│JWT 登录认证

C语言-入门-基础-语法-流程控制(七)
![[Beijing Xunwei] i.mx6ull development board porting Debian file system](/img/46/abceaebd8fec2370beec958849de18.jpg)
[Beijing Xunwei] i.mx6ull development board porting Debian file system
随机推荐
Dynamic memory management
Kotlin inheritance
C # use stopwatch to measure the running time of the program
C # better operation mongodb database
What does the neural network Internet of things mean? Popular explanation
#夏日挑战赛#带你玩转HarmonyOS多端钢琴演奏
Delete the characters with the least number of occurrences in the string [JS, map sorting, regular]
Aiming at the "amnesia" of deep learning, scientists proposed that based on similarity weighted interleaved learning, they can board PNAS
Neural network IOT platform construction (IOT platform construction practical tutorial)
Qt编写物联网管理平台38-多种数据库支持
C language - Introduction - Foundation - grammar - process control (VII)
Prometheus installation
In the first month of its launch, the tourist praise rate of this campsite was as high as 99.9%! How did he do it?
Talking about cookies of client storage technology
Six stones programming: about code, there are six triumphs
Write it down once Net analysis of thread burst height of an industrial control data acquisition platform
Huawei Nova 10 series supports the application security detection function to build a strong mobile security firewall
Selected review | machine learning technology for Cataract Classification / classification
Pointnext: review pointnet through improved model training and scaling strategies++
Kotlin cycle control