MCPcopy
hub / github.com/Textualize/textual / delay_update

Method delay_update

src/textual/app.py:1080–1097  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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]:

Callers 2

switch_modeMethod · 0.95
_select_or_commandMethod · 0.80

Calls 2

_begin_batchMethod · 0.95
set_timerMethod · 0.80

Tested by

no test coverage detected