当前位置:网站首页>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:
边栏推荐
- 产业互联网的产业范畴足够大 消费互联网时代仅是一个局限在互联网行业的存在
- MySQL --- 数据库查询 - 基本查询
- [Arduino experiment 17 L298N motor drive module]
- Key wizard play strange learning - front desk and Intranet send background verification code
- (C language) data storage
- Strongly connected components of digraph
- matlab将数字矩阵保存为地理空间数据出错,显示下标索引必须为正整数类型或逻辑类型,解决
- MySQL basic usage 02
- Basic remote connection tool xshell
- ThinkPHP+Redis实现简单抽奖
猜你喜欢
无向图的割点
Infrared thermography temperature detection system based on arm rk3568
Find a benchmark comrade in arms | a million level real-time data platform, which can be used for free for life
Rk3568 development board evaluation (II): development environment construction
What is needed to develop a domestic arm intelligent edge computing gateway
Excel calculates the difference between time and date and converts it into minutes
【FPGA教程案例6】基于vivado核的双口RAM设计与实现
dotConnect for PostgreSQL数据提供程序
(C language) data storage
1696C. Fishingprince Plays With Array【思维题 + 中间状态 + 优化存储】
随机推荐
删除有序链表中重复的元素-II
链表内指定区间反转
Key wizard hit strange learning - automatic path finding back to hit strange points
MySQL foundation 06 DDL
SwiftUI 组件大全之使用 SceneKit 和 SwiftUI 构建交互式 3D 饼图(教程含源码)
matlab将数字矩阵保存为地理空间数据出错,显示下标索引必须为正整数类型或逻辑类型,解决
有向图的强连通分量
Excel removes the data after the decimal point and rounds the number
Meibeer company is called "Manhattan Project", and its product name is related to the atomic bomb, which has caused dissatisfaction among Japanese netizens
Merge K sorted linked lists
465. DFS backtracking of optimal bill balance
2022 cable crane driver examination registration and cable crane driver certificate examination
MySQL
按键精灵打怪学习-多线程后台坐标识别
MySQL
Kivy教程大全之如何在 Kivy 中创建下拉列表
【我的OpenGL学习进阶之旅】关于欧拉角、旋转顺序、旋转矩阵、四元数等知识的整理
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
matlab 多普勒效应产生振动信号和处理
Telephone network problems