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?
-
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?
-
@shinyformica ui.Slider has an attribute "touch_enabled"
-
@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 objectsw = 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
-
@shinyformica, it has not been exposed in the Python API, but still pretty easy to use:
s = Slider() s.objc_instance.setEnabled_(False)
-
@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.
-
@shinyformica, Google for ”Pythonista-Issues”.