4

I have a small problem and I am working on a small app that uses the python kivy gui framework. All i want is to hide the titlebar of the main window and make the background color transparent. I searched the net intensively but I couldn't find a solution for this.

Does anyone know how to do this?

Thanks

2 Answers 2

7

There is a simpler way:

from kivy.app import App
from kivy.core.window import Window

class MyApp(App):
    def build(self):
        Window.borderless = True

# ...

http://kivy.org/docs/api-kivy.core.window.html#kivy.core.window.WindowBase.borderless

1
  • 2
    Window.fullscreen = 'fake' give the same result of borderless = True.
    – chirale
    Apr 30, 2017 at 7:15
4

You can disable bar using kivy.config.Config. Set fullscreen as fake:

from kivy.config import Config
Config.set('graphics', 'fullscreen', 'fake')

from kivy.app import App
from kivy.uix.button import Button

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()

You can find more configuration options here: http://kivy.org/docs/api-kivy.config.html#available-configuration-tokens For example, to also change position of window:

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

from kivy.app import App
from kivy.uix.button import Button

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()

Unfortunately, I don't know whether it's possible to add transparency.

1
  • 5
    fake is now deprecated. Use borderless = True instead. Sep 25, 2015 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.