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.


    Is there a way to programmatically highlight a ui.SegmentedControl?

    Pythonista
    2
    3
    1999
    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.
    • ccc
      ccc last edited by

      Is there a way to programmatically highlight a segment of a ui.SegmentedControl?

      seg = ui.SegmentedControl()
      seg.selected_index = 0  # does not set the highlight
      

      See: https://github.com/cclauss/Pythonista_ui/blob/master/segmented_table.py

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

        setting selected_index works for me, in the beta. Make sure you actually have some segments defined! setting segments clears the highlight. So just move your line down after you define the segments.

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

          Thanks @JonB that works perfectly.

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