我怎样才能改变基维窗口的位置 [英] How can i change kivy window position
问题描述
是否有其他方法可以不使用以下方式更改窗口位置:
from kivy.config import Config
Config.set('graphics', 'position', 'custom')
Config.set('graphics', 'left', 100)
Config.set('graphics', 'top', 100)
我不想使用此,因为当我用我的属性更改最后一个参数(100
)时,它不起作用.
I don't want to use this because when i change the last parameter (100
) with my property it doesn't work.
推荐答案
当前的主分支具有此更改.
更新:当前的Kivy稳定版本→1.10.0
可能是这样.
Update: It's possible with the current Kivy stable version → 1.10.0
.
由此您可以访问Window.top
和Window.left
属性,并在运行时更改Window
位置,以及获取Window
的实际位置.没有这种更改(例如1.9.1版),就无法做到这一点.
With that you can access the Window.top
and Window.left
properties and change Window
position at runtime as well as get the actual position of the Window
. Without that change (e.g. version 1.9.1), there's no way how to do that.
另外,Config
基本上是针对单个更改,例如应用程序实际运行之前.将位置设置为[0,0],窗口将在App().run()
之后显示在该位置.没什么了.
Also, Config
is basically for a single change before the application actually runs e.g. set the position to [0, 0] and the Window will display at that position after App().run()
. Nothing more really.
这篇关于我怎样才能改变基维窗口的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!