Skip to content

Messages: how to use them in a non-widget context (is that even possible?) #5665

Answered by ddkasa
BurnoutDV asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @BurnoutDV,

Depending on your use case using a ContentSwitcher might be a better solution. In general screens are useful if you are dealing with different data in each of the screens, but from the information you have given it sounds like you are trying to handle the same data.

Events bubble to their parents and each Screen will be in in its own separate 'column' and the screens will not know about events in the other screens. See Bubbling. If you want to handle these events you will have to do so at the App level.

One way to do this would be to handle the event in App class and control your screens from there:

# In your App subclass
@on(ReDrawEvent)
def message_redraw(self) -> None:
    

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BurnoutDV
Comment options

Answer selected by BurnoutDV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants