Pythonista-Issues icon indicating copy to clipboard operation
Pythonista-Issues copied to clipboard

will_close() and wait_modal() not working on presented view

Open baschni opened this issue 1 year ago • 0 comments

Hello,

in my program I have three views (each one called in the init of the previous one, the first one in the main thread), that I present on top of each other. The third view is presented without a close button and is to be closed only via a swipe down gesture. This view will start an audio player.

lesson_view.present('sheet', animated=False,hide_title_bar=True) lesson_view.wait_modal() print("now stop the audio player")

The will_close() event will not be called, as it is only called when pressing the x button (not available when hide_title_bar=True). The wait_modal() function only works on the view in the main thread, not on the call of the third view nested in the other views.

Are these two bugs known? Is there a workaround so I can track when the third view is closed and how I can stop the player?

Kind regards Bastian

baschni avatar Apr 26 '24 10:04 baschni