Logan Darby Logan Darby - 4 months ago 36
Python Question

How to position a borderless window in Kivy

I was making an app with Kivy in python, and to make things a tad more stylish, I thought I could remove the border on the window and create by own:

from kivy.config import Config
from kivy.core.window import Window
Window.size = (900,550)
Window.borderless = True
Config.set('graphics','resizable',0)


However the border less window will pop up in the very bottom left corner of my screen. Is there anyway I can position the window so its in the middle of my screen?

If I can't do that, then is there a way to remove the rounded corners on a window?

(I am doing this on a Mac OSX Yosemite)

Answer

Borderless:

from kivy.config import Config
Config.set('graphics','borderless',1)
Config.set('graphics','resizable',0)

at the top of your file before anything else. Just the core(Window) will remain.

Position:

Config.set('graphics','position','custom')
Config.set('graphics','left',500)
Config.set('graphics','top',10)

the same condition applies for all Config.set().

Comments