Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. Kivy provides you the functionality to write the code for once and run it on different platforms. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.
Kivy is that platform where the size does not matter a lot as it is self-adjusting accordingly but What if we want to fix the size to some extent whether its hight wise or width wise or free from boundation depends on the user requirement.
In this article, we are going to see three formats of resizing the window size in kivy.
Note: Just note the size in the outputs of the window and check the minimize and maximize button on window when it is visible or when not visible.
For resizing window we have:
from kivy.config import Config
Kivy has a configuration file which determines the default settings. In order to change these settings, you can alter this file manually or use the Config object.
Configuration options control the initialization of the App. In order to avoid situations where the config settings do not work or are not applied before window creation (like setting an initial window size),
Config.set should be used before importing any other Kivy modules. Ideally, this means setting them right at the start of your
When there is no fix window size i.e fully resizable according to user:
No resizing, fixed size with the width:
Fix the hight of the window:
We can use both height and width restriction together:
- Python | Add Label to a kivy window
- Python | Make a simple window using kivy
- Python | StackLayout in Kivy
- Python | Canvas in kivy
- Python | PageLayout in Kivy
- Python | Scatter in kivy
- Python | Bubble in kivy
- Python | Kivy .kv File
- Python | Accordion in kivy
- Python | Animation in Kivy
- GridLayouts in Kivy | Python
- Python| AnchorLayout in Kivy
- Python | Float Layout in Kivy
- Python | Switch widget in Kivy
- Python | Tabbed panel in kivy
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Akanksha_Rai