当前位置:网站首页>Kivy tutorial 07 component and attribute binding implementation button button click to modify the label component (tutorial includes source code)
Kivy tutorial 07 component and attribute binding implementation button button click to modify the label component (tutorial includes source code)
2022-07-04 04:36:00 【Knowledge fatness】
Actual combat needs
Component and attribute binding implement buttons button Click Modify label Components
Running effect

Solution
1. to label Component add id
Label:
id: time
text: 'format:[b]00[/b]:00:00'
markup: True
2. We go through id modify label The text of
self.root.ids.time.text = "hello"
3. add to button Components
Button:
id: start_stop
text: 'Start'
font_size: 25
bold: True
border: (2, 2, 2, 2)
on_press: app.start()
adopt on_press To specify the response function
4. Write response functions
def start(self):
self.root.ids.time.text = "hello"
Complete code
from kivy.app import App
from kivy.lang import Builder
from kivy.core.windo边栏推荐
- Unity Resource path
- Experience sharing of epidemic telecommuting | community essay solicitation
- Many founders of technology companies provided enterpriser first with a round C financing of up to US $158million to help it invest in the next generation of global innovators
- 疫情远程办公经验分享| 社区征文
- What should a novice pay attention to when looking for an escort
- [microservice openfeign] @feignclient detailed explanation
- ModStartBlog 现代化个人博客系统 v5.2.0 源码下载
- 十字路口通行优先权,十字路口通行规则图解
- 博朗与Virgil Abloh于2021年为纪念博朗品牌100周年而联合打造的“功能性艺术”将在博物馆展出Abloh作品期间首次亮相
- 领导:谁再用redis过期监听实现关闭订单,立马滚蛋!
猜你喜欢

Redis:集合Set类型数据的操作命令

NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon

旭化成首次参展第五届中国国际进口博览会(5th CIIE)

What does software testing do? Find defects and improve the quality of software

浅谈JVM的那些事

普源DS1000Z系列数字示波器在通信原理实验中的应用方案

Select function variable column name in dplyr of R language

戳气球和布尔运算问题(巨难)

Emlog user registration plug-in is worth 80 yuan

What is context?
随机推荐
Apple CMS imitation watermelon video atmospheric response video template source code
架构实战营 - 第 6 期 模块九之毕业设计
Precautions for accompanying driving these 23 points should be paid attention to!
Senior developers tell you, how to write excellent code?
leetcode:1314. 矩阵区域和【二维前缀和模板】
Cmake compilation option setting in ros2
What is context?
Self sharing of a graduate
Rhcsa 08 - automount configuration
多位科技公司创始人向Entrepreneur First提供高达1.58亿美元的C轮融资,协助其投资下一代全球创新者
[Yugong series] go teaching course 002 go language environment installation in July 2022
Balloon punching and Boolean operation problems (extremely difficult)
更优雅地远程操作服务器:Paramiko库的实践
旭化成首次参展第五届中国国际进口博览会(5th CIIE)
Kivy教程之 更改背景颜色(教程含源码)
Redis: order collection Zset type data operation command
Dp83848+ network cable hot plug
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
普源DS1000Z系列数字示波器在通信原理实验中的应用方案
One click compilation and deployment of MySQL