-
I would like to dynamically disable widget and its descendants and make insensitive to mouse and keyboard events. Can I do it with Textual APIs? I know I can use can_focus / can_focus_children to make widgets not-focusable, so I can make them insensitive to keyboard events, but those widgets still get mouse inputs. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Normally you'd do that with a widget's |
Beta Was this translation helpful? Give feedback.
-
@davep , In my case, I would like to disable custom widgets (composite of Container and Static), and disable not only clicks but also while rotation, etc. Is there solution for that use-case? |
Beta Was this translation helpful? Give feedback.
Normally you'd do that with a widget's
disabled
property. See this bit of code in one of Textual's examples -- it's used to disable the game while the "you've won" message is displayed (and of course later to reenable the game when a new game starts).