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.


    Swipe right to delete one number

    Pythonista
    pythonista python help gesture
    2
    5
    3423
    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.
    • ricky_itly
      ricky_itly last edited by omz

      This post is deleted!
      Phuket2 1 Reply Last reply Reply Quote 0
      • Phuket2
        Phuket2 @ricky_itly last edited by

        @ricky_itly , would be easier to try and help if you posted code that runs. I am guessing you just didn't post the if name ... blah blah (main)code.
        Also in your example you don't do -
        from gestures import Gestures
        I assume its working for you because gestures been imported already from another script.
        Also, there is no mention or link to the gestures repo. Many uses may think that gestures is a built in module if they have not read about it here.

        Please understand, I am not trying to be critical. Just trying to help. I am not so good, but if your code example would have run, then it would have been a lot easier for me to see if i could have helped

        1 Reply Last reply Reply Quote 0
        • ricky_itly
          ricky_itly last edited by

          Yeah sorry, I forgot to post the UI with all the buttons and labels.
          I’m trying to post it

          Phuket2 1 Reply Last reply Reply Quote 0
          • Phuket2
            Phuket2 @ricky_itly last edited by Phuket2

            @ricky_itly , no problems. One way to post your pyui file is to do -

            1. Change the extension of your pyui file to json
            2. You will see the json text of the pyui file.
            3. Copy it and paste into your code, triple quote it and assign it a var name.
            4. Then you can use the load_view_str method

            You can just change back the ext of the file to pyui and you will see your form again.

            If you run the below, it should work. I just did the same as the steps I said above.

            Example.

            import ui
            
            myview = '''\
            [
              {
                "nodes" : [
                  {
                    "nodes" : [
                      {
                        "nodes" : [
            
                        ],
                        "frame" : "{{0, 0}, {124, 32}}",
                        "class" : "Label",
                        "attributes" : {
                          "font_size" : 18,
                          "frame" : "{{-13, 53}, {150, 32}}",
                          "uuid" : "C50766EC-F775-4342-AAF6-3736A0488175",
                          "class" : "Label",
                          "alignment" : "center",
                          "text" : "weeks",
                          "name" : "label1",
                          "font_name" : "<System>"
                        },
                        "selected" : false
                      },
                      {
                        "nodes" : [
            
                        ],
                        "frame" : "{{0, 33}, {124, 104}}",
                        "class" : "DatePicker",
                        "attributes" : {
                          "mode" : 0,
                          "frame" : "{{-98, -40}, {320, 216}}",
                          "class" : "DatePicker",
                          "name" : "datepicker1",
                          "uuid" : "3BED2E56-1F0D-4AD5-AAF0-B779BC766DC7"
                        },
                        "selected" : false
                      }
                    ],
                    "frame" : "{{6, 6}, {124, 137}}",
                    "class" : "View",
                    "attributes" : {
                      "frame" : "{{190, 110}, {100, 100}}",
                      "class" : "View",
                      "name" : "view1",
                      "uuid" : "907D0D1A-C7F8-4E23-BD71-671383E6C239"
                    },
                    "selected" : false
                  }
                ],
                "frame" : "{{0, 0}, {480, 320}}",
                "class" : "View",
                "attributes" : {
                  "enabled" : true,
                  "tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)",
                  "border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)",
                  "background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)",
                  "flex" : ""
                },
                "selected" : false
              }
            ]
            '''
            
            
            if __name__ == '__main__':
                f = (0, 0, 300, 400)
                v = ui.load_view_str(myview)
                v.present(style='sheet', animated=False)
            
            1 Reply Last reply Reply Quote 0
            • Phuket2
              Phuket2 last edited by

              I hope this works out. My first attempt to make a video and post it. But the video is doing the steps above.
              Video

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