需要帮助找出代码,让我在textinput中搜索某些内容,并让所有与搜索匹配的项都出现在boxlayout中。我才刚开始玩kivy(3天前)。在
在主.py在
# import kivy & functions/widgets.
import kivy
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
# import kivy layouts.
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.stacklayout import StackLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
# Specify version or kivy needed.
kivy.require("1.10.1")
class Page(FloatLayout):
pass
class YuGiOhApp(App):
def build(self):
return Page()
YuGiOhApp().run()
我不知道我需要多少进口货,只是有点像是在我和kivy玩的时候留下的。在
在尤吉奥千伏在
^{pr2}$我的kivy代码到目前为止。在
您已经写了一条评论
Even an example of how to add and remove the widgets would help greatly as i can fit it to my own program and needs!
,所以这里是:很简单。您可以使用
^{pr2}$add_widget
方法添加任何小部件的新创建实例—按钮、标签、布局等等。然后您可以通过将其id传递给remove_widget
方法来删除它。您可以从children
属性获取,也可以自己存储,例如:相关问题 更多 >
编程相关推荐