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.


    Does ui.Slider have an enabled state attribute?

    Pythonista
    attributes ui.slider
    3
    6
    3500
    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.
    • shinyformica
      shinyformica last edited by

      Looking at the documentation for the various widgets, I see "enabled" properties for buttons and other controls, but not for sliders? Does that mean sliders can't be disabled?

      A more general question: can an entire view hierarchy be "disabled" in some way? In the sense of somehow setting the enabled state of a View to False, which would disable the entire view hierarchy under it?

      cvp mikael 3 Replies Last reply Reply Quote 0
      • cvp
        cvp @shinyformica last edited by

        @shinyformica ui.Slider has an attribute "touch_enabled"

        1 Reply Last reply Reply Quote 0
        • cvp
          cvp @shinyformica last edited by

          @shinyformica you can define an ui.View with the same frame as the main view, as a sub_view of this main view, with a transparent background and
          sent it to the back if you want to enable other inner objects
          or bring it to the front if you want to disable other inner objects

          w = ui.View()
          w.frame = main_view.frame
          w.background_color = (1,1,1,0)
          main_view.add_subview(w)
          #w.bring_to_front() # disable other
          w.send_to_back() # enable other 
          
          1 Reply Last reply Reply Quote 0
          • mikael
            mikael @shinyformica last edited by

            @shinyformica, it has not been exposed in the Python API, but still pretty easy to use:

            s = Slider()
            s.objc_instance.setEnabled_(False)
            
            1 Reply Last reply Reply Quote 0
            • shinyformica
              shinyformica last edited by

              @mikael thanks! That's what I was looking for...really odd that something which probably should be a base View property isn't exposed for all View subclasses. Perhaps I should request it? Not sure how to do that.

              mikael 1 Reply Last reply Reply Quote 0
              • mikael
                mikael @shinyformica last edited by

                @shinyformica, Google for ”Pythonista-Issues”.

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