Forum Archive

UI elements in modal scene

glitchassassin

I am having difficulty adding a ui.View to a modal subclassed scene.

When the scene is run directly, I can add the view in the scene's setup() method to the scene's view property. However, if the scene is run as a modal scene, its view property is None.

That's not too big a deal. I can just run the modal scene and then trigger the ui.View to be added after it's being presented. But where should the ui.View be added? I can add it to the parent scene's view, but then it doesn't disappear when the modal scene is dismissed.

How should this work?

Here's a gist with what I have with so far (main application logic redacted).

JonB

Perhaps you want to be presenting a modal view, not a modal scene?
For instance, present your login view as a popover or sheet, then wait_modal on the view to wait until it is closed.