omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    [Share Code] `ui.View`: without x-Button

    Pythonista
    2
    2
    1945
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • lukaskollmer
      lukaskollmer last edited by lukaskollmer

      I struggled with that recently and just wanted to share my solution:

      If you don't want the default x-Button at the left side of the title bar, just create a ui.NavigationView and present that instead

      import ui
      
      view = ui.View()
      navigationView = ui.NavigationView(view)
      
      # Add a close button
      view.left_button_items = [ui.ButtonItem(title="Close", action=lambda x: navigationView.close())] 
      
      # Won't show the x-button
      navigationView.present("sheet", hide_title_bar=True)
      
      1 Reply Last reply Reply Quote 2
      • henryaukc
        henryaukc last edited by

        Thanks a lot!

        I have used this to make my script acting a real app by using the “Add to Home Screen” to put my script on the home screen. Without x-button, it looks more like the normal app. However, I have encountered two problems:

        1. When my home screen shortcut was run again, the pythonista ran again my app but not return to the last screen
        2. When I run another Pythonista script on the home screen, it will run on my original script

        Can I detect if my script is now running already and don’t run multiple times to fix problem 1?

        Can I detect that there is another script running and stop Pythonista to load a new one? Or close the old one before loading the new one?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors