当前位置:网站首页>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:边栏推荐
- [shutter] image component (configure local GIF image resources | load placeholder with local resources)
- MySQL basics 03 introduction to MySQL types
- 基本远程连接工具Xshell
- 【FPGA教程案例5】基于vivado核的ROM设计与实现
- Basic concept and implementation of overcoming hash
- The arm core board / development board of Feiling equipped with Ti am62x made its debut in embedded world 2022
- Androd Gradle 对其使用模块依赖的替换
- leetcode 2097 — 合法重新排列数对
- Data analysis, thinking, law breaking and professional knowledge -- analysis method (I)
- Matlab finds the position of a row or column in the matrix
猜你喜欢
![[AUTOSAR VI description document]](/img/3d/1382acbc4054ab218485a12b7b4e6b.png)
[AUTOSAR VI description document]

How wide does the dual inline for bread board need?

MySQL --- 数据库查询 - 基本查询

有向图的强连通分量

机器学习术语

Data analysis, thinking, law breaking and professional knowledge -- analysis method (I)
![[shutter] image component (cached_network_image network image caching plug-in)](/img/cc/967ff62c7f82e1c6613b3d0f26bb3e.gif)
[shutter] image component (cached_network_image network image caching plug-in)
![[AUTOSAR 11 communication related mechanism]](/img/bf/834b0fad3a3e5bd9c1be04ba150f98.png)
[AUTOSAR 11 communication related mechanism]

Daily topic: movement of haystack

Basic use of sringcloud & use of component Nacos
随机推荐
【我的OpenGL学习进阶之旅】关于欧拉角、旋转顺序、旋转矩阵、四元数等知识的整理
2022 Jiangxi Provincial Safety Officer B certificate reexamination examination and Jiangxi Provincial Safety Officer B certificate simulation examination question bank
对非ts/js文件模块进行类型扩充
Foundations of data science is free to download
(C语言)数据的存储
MySQL --- 数据库查询 - 条件查询
Win10 can't be installed in many ways Problems with NET3.5
如今少年已归来,人间烟火气最抚凡人心 复工了~
matlab 多普勒效应产生振动信号和处理
Data analysis, thinking, law breaking and professional knowledge -- analysis method (I)
dotConnect for PostgreSQL数据提供程序
R language generalized linear model function GLM, (model fit and expression diagnostics), model adequacy evaluation method, use plot function and car package function
MySQL
ThinkPHP+Redis实现简单抽奖
用Go+绘制爱心给心爱的她表白
[shutter] image component (cached_network_image network image caching plug-in)
FPGA - 7系列 FPGA内部结构之Clocking -04- 多区域时钟
MySQL --- 数据库查询 - 基本查询
按键精灵打怪学习-自动寻路回打怪点
The latest analysis of tool fitter (technician) in 2022 and the test questions and analysis of tool fitter (technician)