📜  在 kivy 中将 Widget 大小设置为 python 的父大小 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:06.149000             🧑  作者: Mango

代码示例1
A widget keeps a reference to its parent in self.parent.
So you can just use

self.parent.size or self.parent.pos or whatever.

Depending on what you're doing,
it may be necessary or useful to make sure
you check if self.parent is None first, 
so that your code doesn't fail for widgets with no parent.