@shinyformica try this, it is the way omz wrote dialog: using wait_modal and resetting the view just after.
import ui
from objc_util import *
class Popover(ui.View):
def __init__(self, *args, **kws):
ui.View.__init__(self, *args, **kws)
self.width = 200
self.height = 50
self.label = ui.Label()
self.label.text = "test"
self.add_subview(self.label)
self.label.x = 0
self.label.y = 0
self.label.width = self.width
self.label.height = self.height
def will_close(self):
print("popover closing")
class MyView(ui.View):
def __init__(self, *args, **kws):
ui.View.__init__(self, *args, **kws)
self.popover = None
self.button = ui.ButtonItem()
self.button.title = "Show Popover"
self.button.action = self.showPopover
self.right_button_items = (self.button,)
def showPopover(self, sender):
print("show popover")
if self.popover is None:
self.popover = Popover()
self.popover.present(style="popover", popover_location=(self.width-100,50), hide_title_bar=True)
self.popover.wait_modal()
self.popover = None
def run():
v = MyView()
v.present('full_screen')
if __name__ == '__main__':
run()```