Delay updates for a short period of time. May be used to mask a brief transition. Consider this method only if you aren't able to use `App.batch_update`. Args: delay: Delay before updating.
(self, delay: float = 0.05)
| 1078 | self.check_idle() |
| 1079 | |
| 1080 | def delay_update(self, delay: float = 0.05) -> None: |
| 1081 | """Delay updates for a short period of time. |
| 1082 | |
| 1083 | May be used to mask a brief transition. |
| 1084 | Consider this method only if you aren't able to use `App.batch_update`. |
| 1085 | |
| 1086 | Args: |
| 1087 | delay: Delay before updating. |
| 1088 | """ |
| 1089 | self._begin_batch() |
| 1090 | |
| 1091 | def end_batch() -> None: |
| 1092 | """Re-enable updates, and refresh screen.""" |
| 1093 | self._end_batch() |
| 1094 | if not self._batch_count: |
| 1095 | self.screen.refresh() |
| 1096 | |
| 1097 | self.set_timer(delay, end_batch, name="delay_update") |
| 1098 | |
| 1099 | @contextmanager |
| 1100 | def _context(self) -> Generator[None, None, None]: |
no test coverage detected