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.


    Help with Ui Segment Bar

    Pythonista
    5
    12
    7443
    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.
    • SeaUrchin
      SeaUrchin last edited by

      Oh ok, I see, so you just made it yourself instead of the ui feature. Thanks!

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

        This does not seem to run in the output. I'm sorry if I needed to do something, after all this is my first day programming. What do I do to make it run?

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

          Add this line at the end of the script:

          view.present()
          
          1 Reply Last reply Reply Quote 0
          • SeaUrchin
            SeaUrchin last edited by

            Thank you very much!

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

              def segment_action(sender):
                  seg_name = sender.segments[sender.selected_index]
                  console.alert(seg_name + ' has been selected')
              
              1 Reply Last reply Reply Quote 0
              • SeaUrchin
                SeaUrchin last edited by

                I have also changed the console alerts to speech, so that it can be said while the Ui is running. Very cool speech module!

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

                  Whoops, didn't see your post before mine. I will try that as well!

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

                    console.hud_alert is also a good alternative to console.alert, as it does not interfere with the ui.

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

                      If you want to make a console.alert pop up over a UI, then just do this:

                      @ui.in_background
                      def popup():
                          console.alert("hello")
                      popup()
                      

                      This makes the program run in the background that way you can have it pop up.

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

                        @AtomBombed thanks!

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