Reputation: 37
I am building a python desktop application using Kivy and would like to find out how to create a borderless window similar to how EVE Online does it: EVE Online launch screen.
This is where I am now, and what I want to achieve in the next step: What I want to accomplish
I've spent hours Googling for a solution, but the closest I've ever come were these links: How can I hide the main window titlebar and place a transparent background in kivy framework?, and this: Borderless windows in wxPython
Here is the current code (Python 2.7, Kivy 1.9):
from kivy.app import App
from kivy.uix.button import Button
from kivy.config import Config
Config.set('graphics', 'width', '480')
Config.set('graphics', 'height', '320')
Config.set('graphics', 'borderless', '1')
class MyApp(App):
def build(self):
button = Button(text="Exit", size_hint=(None, None))
button.bind(on_press=exit)
return button
if __name__ == '__main__':
MyApp().run()
I would like to see if this can be accomplished in Kivy. Would you be able to suggest some approaches to this problem? Thanks!
Upvotes: 0
Views: 6301
Reputation: 288
To create a borderless window set the Windows.borderless property to true
from kivy.core.window import Window
Window.size = (500, 300)
Window.borderless = True
Be sure to provide an alternative way to exit your program since you won't be able to click on window close buttons normally provided by the OS.
see kivy.core.window documentation
Upvotes: 5
Reputation: 841
You could add Config.set ('graphics', 'resizable', '0') which removes the remaining border part of the window. The drawback is that the window is not draggable anymore and stays on a fixed position.
Upvotes: 0
Reputation: 118
You can use the widget BoxLayout and configure the settings so it will appear as you want it to. I'm new to Kivy, but these videos explain it very well: https://m.youtube.com/watch?v=-NvpKDReKyg hopefully this helps a bit!
Upvotes: 0