当前位置:网站首页>Kivy tutorial how to create drop-down lists in Kivy
Kivy tutorial how to create drop-down lists in Kivy
2022-07-03 01:18:00 【Knowledge fatness】
Below I provide a usage ScreenManager stay Kivy An example of creating a drop-down list in . Please note that , This applies to all layouts , But I found that GridLayout Is the easiest to control . You can copy and paste it into your code .

from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.lang import Builder
Builder.load_file("try_out_app.kv")
class ExampleScreen(Screen):
pass
class RootWidget(ScreenManager):
pass
class Demo(App):
def build(self):
return RootWidget()
if __name__ == "__main__":
Demo().run()
Interface
<ExampleScreen>:
name: "example_screen"
GridLayout:
cols: 1
padding: 100, 20
size_hint: 0.5, 0.5
Button:
id: btn
text: "select"
size_hint: None, None
on_parent: drop_content.dismiss()
on_release: drop_content.open(self)
DropDown:边栏推荐
- 2022 Jiangxi Provincial Safety Officer B certificate reexamination examination and Jiangxi Provincial Safety Officer B certificate simulation examination question bank
- Arduino DY-SV17F自动语音播报
- [flutter] icons component (fluttericon Download Icon | customize SVG icon to generate TTF font file | use the downloaded TTF icon file)
- JDBC courses
- MySQL
- Esp32 simple speed message test of ros2 (limit frequency)
- Makefile中wildcard、patsubst、notdir的含义
- Machine learning terminology
- 机器学习术语
- [untitled]
猜你喜欢

Basic remote connection tool xshell

拥抱平台化交付的安全理念

leetcode 6103 — 从树中删除边的最小分数

Database SQL language 01 where condition

Matlab saves the digital matrix as geospatial data, and the display subscript index must be of positive integer type or logical type. Solve the problem

Leetcode 6103 - minimum fraction to delete an edge from the tree
![[AUTOSAR XIII NVM]](/img/38/805ab70f199e2cfad4d9dae0e2c1ff.png)
[AUTOSAR XIII NVM]

FPGA - 7系列 FPGA内部结构之Clocking -04- 多区域时钟

RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide

(C language) data storage
随机推荐
Database SQL language 02 connection query
正确甄别API、REST API、RESTful API和Web Service之间的异同
Asynchronous, email and scheduled tasks
Explain the basic concepts and five attributes of RDD in detail
每日一题之干草堆的移动
[love crash] neglected details of gibaro
Basic use of sringcloud & use of component Nacos
关于Fibonacci数列
[C language] branch and loop statements (Part 1)
基本远程连接工具Xshell
12_微信小程序之微信视频号滚动自动播放视频效果实现
按键精灵打怪学习-前台和内网发送后台验证码
拥抱平台化交付的安全理念
Win10 can't be installed in many ways Problems with NET3.5
How wide does the dual inline for bread board need?
MySQL foundation 07-dcl
Every k nodes in the linked list are flipped
Matlab Doppler effect produces vibration signal and processing
R language uses coin package to apply permutation tests to independence problems (permutation tests, whether response variables are independent of groups, are two numerical variables independent, and
MySQL基础用法02