Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I turn off fullscreen in Kivy?

All Kivy (1.8.0) applications run fullscreen on my PC by default. I need to turn fullscreen off for only one (not for each) Kivy application. Strange, but I haven't found the answer for this simple question. Probably, that's not Kivy, but Pygame, but anyway I don't know how to trun it off. Kivy and Pygame were taken from here.

like image 386
Necronomicron Avatar asked Jul 15 '14 17:07

Necronomicron


People also ask

How can I get window width in KIVY?

Kivy Config File We must import the Config class to set the window size. Then we have to configure the window's width and height. To accomplish this, we use the Config object's set method.

Is KIVY fast?

Kivy is very fast and efficient for a lot of things - in terms of basic graphics operations you can easily push and manipulate thousands of vertices with complex effects at no perceptible slowdown.

Is Python KIVY free for commercial use?

Kivy is a free and open source Python framework for developing mobile apps and other multitouch application software with a natural user interface (NUI).

Can I use KIVY with C++?

I've used python-for_android to create a kivy based application running on android. Some parts of my application have been optimized in c++ using cython. I manage to compile all my code using python for android and a custom recipes. My code also works perfectly with kivy under linux.


2 Answers

I know this is an old question but if anyone runs in to this problem again and you want to set the config options as default.

In a terminal.

from kivy.config import Config
Config.set('graphics', 'fullscreen', '0')
Config.write()
like image 71
Eric MacLeod Avatar answered Sep 29 '22 12:09

Eric MacLeod


You can configure the way window will be displayed using kivy.config.Config before importing any Kivy module. For example, to have fullscreen application (this shouldn't be enabled by default):

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

In your case you can try to set it explicitly:

#!/usr/bin/python
# -*- coding: utf-8 -*-

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

from kivy.app import App

class TestApp(App):
    pass

if __name__ == '__main__':
    TestApp().run()

You can find details about graphics:fullscreen option in documentation.

like image 34
Nykakin Avatar answered Sep 29 '22 14:09

Nykakin