How can i change kivy window position

℡╲_俬逩灬. 提交于 2020-12-10 05:19:30

问题


Is there any other way to change window position without using:

from kivy.config import Config
Config.set('graphics', 'position', 'custom')
Config.set('graphics', 'left', 100)
Config.set('graphics', 'top',  100)

I don't want to use this because when i change the last parameter (100) with my property it doesn't work.


回答1:


It's possible with the current master branch that has this change.

Update: It's possible with the current Kivy stable version → 1.10.0.

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.

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.



来源:https://stackoverflow.com/questions/41703092/how-can-i-change-kivy-window-position

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!