Kivy Help Needed. Close Button

I don’t know much Kivy, so bear with me. Is it possible to programatically close SimulationCanvas from within SimulationCanvas? I’m using it as a basis to do something else, and I have to do some cleanup before it is closed. Click outside the window closes it, but that skips the cleanup I want to do.

1 Like

I’m kivy challenged as well. Kivy masters we need your help.

Thank you

I doubt this is the correct way, but I used a string of parents to get back to the Popup to dismiss it.

self.parent.parent.parent.dismiss()

Seems to work, but if the .kv file changes the depth of the button, then I’ll have to add/remove a parent to get it to work.

1 Like

This kind of deep referencing can be tough in Kivy.

I’m not sure if it’s more right or not but you could put a pointer in data to that object so it would just be data.canvasObject.dismiss()

1 Like