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.


    Shut off "swipe to delete" with list_dialogs

    Pythonista
    2
    5
    3164
    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.
    • donnieh
      donnieh last edited by ccc

      Can swipe to delete be turned off? I ask because I want to use it as a read only list.

      import dialogs
      list = ['Apple', 'Orange', 'Pear']
      selected = dialogs.list_dialog(title='Fruit', items=list, multiple=False)
      
      1 Reply Last reply Reply Quote 0
      • donnieh
        donnieh last edited by donnieh

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • omz
          omz last edited by

          This looks like a bug to me. The list shouldn't be editable, I'll look into it.

          1 Reply Last reply Reply Quote 1
          • omz
            omz last edited by

            Definitely a bug, here's a quick workaround for now:

            import dialogs
            
            def list_dialog(title='', items=None, multiple=False, done_button_title='Done'):
            	c = dialogs._ListDialogController(title, items, multiple, done_button_title=done_button_title)
            	c.view.data_source.delete_enabled = False
            	c.view.present('sheet')
            	c.view.wait_modal()
            	return c.selected_item
            
            1 Reply Last reply Reply Quote 1
            • donnieh
              donnieh last edited by

              Ok, great. Thank you for your time!

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