diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-04-02 16:15:55 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-04-02 16:15:55 +0300 |
commit | 7016d5fd00b6c1960a531f796dddf1afdf2aecf0 (patch) | |
tree | 7f1c34a1029a989c5a1302286a8cf203ba40312b /ttystatus | |
parent | 4e4fe35ec18b50aa6c1b365ad7ed94753df140ed (diff) | |
download | python-ttystatus-7016d5fd00b6c1960a531f796dddf1afdf2aecf0.tar.gz |
Force all widgets to be rendered when any are added
Diffstat (limited to 'ttystatus')
-rw-r--r-- | ttystatus/status.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ttystatus/status.py b/ttystatus/status.py index debd576..77f0b18 100644 --- a/ttystatus/status.py +++ b/ttystatus/status.py @@ -47,6 +47,7 @@ class TerminalStatus(object): self._widget_rows = [[]] self._widget_rows[-1].append(widget) self._register_interests(widget) + self.flush() def _register_interests(self, widget): if getattr(widget, 'interested_in', None) is None: @@ -62,6 +63,7 @@ class TerminalStatus(object): if not self._widget_rows: self._widget_rows = [[]] self._widget_rows.append([]) + self.flush() def format(self, format_string): '''Add new widgets based on format string. @@ -78,6 +80,7 @@ class TerminalStatus(object): self.start_new_line() for widget in ttystatus.parse(line): self.add(widget) + self.flush() @property def widgets(self): |