我想创建一个具有固定大小和背景的小工具。它将首先添加到BoxLayout中。我想在这个小部件里面画一条线,这样它就只在其中可见,并与它相关。通过输入(0,0)行的位置,我指的是小部件的开始,而不是整个应用程序窗口。如何达到这种效果?from random import randomfrom kivy.graphics import Color, Ellipse, Line
from<
如何创建继承自它的类,唯一的变化是使用id: target向BoxLayout添加了一个额外的小部件 我尝试将动态类更改为规则,并在python中定义类: class Foo(BoxLayout):__init__(**kwargs)
self.ids["target"].add_widget(<the widget I want to add>, index=0) 但是,__init__函数(和on_parent函数)中