-
On https://textual.textualize.io/guide/widgets/#data-flow it is written that Widgets should update their parents only by sending messages to them. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If your widgets can be confident that My approach these days is to use the same data flow rules for anything involving the application class as with any other container. That's to say, ideally, I never have a widget call a method on |
Beta Was this translation helpful? Give feedback.
-
Hi Dave, thanks for your answer! Maybe it would make sense to include the information you posted in the documentation? Thank you very much! |
Beta Was this translation helpful? Give feedback.
If your widgets can be confident that
self.app
is of a type that has the methods you want to call, then you won't run into any problems. This does, however, mean your widgets won't be that portable; this may or may not be a concern.My approach these days is to use the same data flow rules for anything involving the application class as with any other container. That's to say, ideally, I never have a widget call a method on
self.app
(other than those that are documented to be part ofApp
) and instead send up messages.