Disable stop button (X) in Scene
I would like to disable the stop button (X) in the upper right hand corner. I found one solution on this forum, but that doesn't seem to work anymore.
So my question is on how to disable the X button (hide the status bar?)?
This works for me, you have to slide two fingers on screen to close it.
# Hide X button import ui view = ui.View(bg_color = 'slateblue') view.present('sheet', hide_title_bar=True)
That's a solution for UI. How do I do that in Scene?
iirc for scene you need to use a SceneView and use this approach.
Maybe stupid, but how do I do that?
Hide_title_bar does not work for me. Not sure why people recommend it.
This is a solution I came up with.
class MyScene(scene.Scene): def setup(self): self.label = scene.LabelNode('Test hide title bar', position=self.size/2, parent=self) self.hide_close() def hide_close(self, state=True): from obj_util import ObjCInstance v = ObjCInstance(self.view) # Find close button. I'm sure this is the worst way to do it for x in v.subviews(): if str(x.description()).find('UIButton) >= 0: x.setHidden(state) scene.run(MyScene())