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.
Disable sub view = disable object in it automatically?
-
I want to disable a sub view, if I do that automatically all the buttons, textfield will be disable too.
Thanks.
-
@sendog3c, this seems to work:
view.objc_instance.setEnabled_(False)
... although the contained elements do not show the visual cues of being disabled (e.g. greyed-out text), so there is little practical difference to just setting:
view.touch_enabled = False
If the visual cues are important to you, I suggest writing a little utility function that loops through the
subviews
of a view and sets the value of theenabled
property, if it exists (usehasattr
), ortouch_enabled
otherwise. -
Thank you Maikel let me to digest it 🤭🤭🤭😂😂😂😂😂, before implement