【发布时间】:2015-01-18 19:34:19
【问题描述】:
我正在寻找如何将按钮的相同属性放在像 css 语言这样的组中...
我有这个 kivy 文件:
<Clavier>:
Button:
pos: 0, root.width / 5
size: root.width / 10 , root.width / 10
text: 'A'
Button:
y: root.width / 5
x: root.width / 10
size: root.width / 10 , root.width / 10
text: 'Z'
Button:
y: root.width / 5
x: root.width / 5
size: root.width / 10 , root.width / 10
text: 'E'
Button:
y: root.width / 5
x: root.width * 3 / 10
size: root.width / 10 , root.width / 10
text: 'R'
Button:
y: root.width / 5
x: root.width * 4 / 10
size: root.width / 10 , root.width / 10
text: 'T'
...
我们可以优化这段代码吗?
感谢阅读。
【问题讨论】: