Fuzzyma
Fuzzyma

Reputation: 8474

How do I make window visiable/invisible at runtime?

I am using kivy to create a small Gui for my python program. This Gui is not always visible. So I start it with these settings:

Config.set('graphics', 'borderless', True)
Config.set('graphics', 'resizable', False)
Config.set('graphics', 'window_state', 'hidden')

However: Somewhere in my program I want to make the window visible again. How do I do that? I couldnt find anything that changes configuration at runtime.

Upvotes: 1

Views: 669

Answers (2)

tgikal
tgikal

Reputation: 1680

I'm not familiar with Kivy, but it looks like you just need to set it to visible.

window_state: string , one of 'visible', 'hidden', 'maximized' \ or 'minimized'

from: https://kivy.org/docs/_modules/kivy/config.html

Looking at this github post: https://github.com/kivy/kivy/issues/3637

The method they're using is .hide() and .show().

Upvotes: 1

Yoav Glazner
Yoav Glazner

Reputation: 8066

It seems that if you are using the SDL provider you have a hide & show functions on the Window object

from the kivy.core.window docs:

hide() Added in 1.9.0
Hides the window. This method should be used on desktop platforms only.

Note
This feature requires the SDL2 window provider and is currently only supported on desktop platforms.

show()¶Added in 1.9.0
Shows the window. This method should be used on desktop platforms only.

Note
This feature requires the SDL2 window provider and is currently only supported on desktop platforms.

Upvotes: 2

Related Questions