-
I want to show an "action log" in my app that's visible on all screens. So the user can navigate a tree of menu screens, but each screen should show the same instance of I created something like this: class GlobalLog(RichLog):
_instance = None
@classmethod
def instance(cls):
if GlobalLog._instance is None:
GlobalLog._instance = cls(highlight=True, markup=True)
return GlobalLog._instance and I Any help is appreciated, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can't re-use widgets. You will need to construct an instance when you add it to the DOM. Having a rich log showing the same data on all screens is an odd requirements. I suspect this may be an XY problem. Maybe if you explain what you are trying to solve, I can offer suggestions. |
Beta Was this translation helpful? Give feedback.
... sure
I have a global list of log entries now, and whenever I append a log, I add it to the active screen's log. The
on_screen_resume
handler clears the log and then fills it again with all log entries, to avoid duplicates. Thanks…