Skip to content Skip to sidebar Skip to footer

Triggering Popup.dismiss() In A Method Which Didn't Call Popup.open() (kivy)

I'm trying to develop a kivy app for my less-comp-savvy colleagues which wraps a nice GUI around some computations which I developed for a project; currently I have two methods emb

Solution 1:

Try assigning your popup to a variable in your class which inherits from App (I'll call this your "main app class"). You can reference variables and functions from within your main app class by using App.get_running_app().your_variable in Python or simply app.your_variable in the kv language.

For your case, remove the line in GUI.py Pop().open() and replace it with the following line:

App.get_running_app().pop.open()

Then in your graphics class, create a variable for the popup. You can do this in the build function, just add self.pop = Pop()

Now, in your calc.py program, you will need to add from kivy.app import App, then at the end of your main function, add the line to dismiss the popup:

App.get_running_app().pop.dismiss()

Post a Comment for "Triggering Popup.dismiss() In A Method Which Didn't Call Popup.open() (kivy)"