• @JonB true enough...double conversion isn't necessary, was just writing fast...here's a simplified version:

    def popoverPoint(topView, sourceView, pos): import objc_util x,y = pos srcobjc = sourceView.objc_instance topobjc = topView.objc_instance p = srcobjc.convertPoint_toView_(objc_util.CGPoint(x,y), topobjc.superview()) return (p.x,p.y)

    This is a popup to display a list of options to the user, so the popover has a TableView subview, and tapping an item in that view dismisses the popover. Working nicely now that it shows up where expected.

  • @shinyformica, if I understand your requirement right, it is as simple as:

    button.frame = v.bounds button.flex = 'WH'
  • I just realised the error. It’s meant to be Rect(self.player.position.x-12, self.player.position.y-12, 24, 24) I forgot the .x on the end of position. Thanks for making me notice it!

  • You can set view.hidden =True, which sort of does what you are asking, at least for initial setup. You will see the empty view while things are prepared, but you could add an ActivityIndicator

    Also, ui.delay (not animate like i thought) will cause everything to happen at once -- the ui is not updated until the delayed function exits.

    See this example, where I show 4 methods. For a really slow setup function, you see the subviews get added one by one using the basic method (present, then setup the view) which is undesirable. Using ui.delay is nice, and you can show an activity indicator while the view sets up. You can use hidden on your root view, though it shows black while setting up. So, you can have a subview of root as your main view, and just hide the subview. This method also lets you add an activity indicator. This is probably my favorite approach. You could even write it as a context manager.


Internal error.

Oops! Looks like something went wrong!