Register callbacks at message pump level, invoke them after refresh (#607)

* Register callbacks at message pump level, invoke them after refresh

* Fix a typo

* Code review feedback actions

* call_later callbacks invoked after refresh or on idle

* Fix space key in text input

* Make Widget.on_idle synchronous

* Fix call_later

* Rename PostScreenUpdate to InvokeCallbacks, and only fire if callbacks exist

* Update type hints for InvokeLater callbacks

* Update type signature of call_later callbacks, extract typevar
This commit is contained in:
darrenburns
2022-08-05 13:47:47 +01:00
committed by GitHub
parent 589bf6a1bc
commit a166d84eef
10 changed files with 66 additions and 19 deletions

View File

@@ -12,6 +12,8 @@ from textual.geometry import Size
from textual.widget import Widget
from textual.widgets import Placeholder
pytestmark = pytest.mark.integration_test
# Let's allow ourselves some abbreviated names for those tests,
# in order to make the test cases a bit easier to read :-)
SCREEN_W = 100 # width of our Screens
@@ -26,7 +28,6 @@ SCROLL_V_SIZE = 2
@pytest.mark.asyncio
@pytest.mark.integration_test # this is a slow test, we may want to skip them in some contexts
@pytest.mark.parametrize(
(
"placeholders_count",
@@ -164,7 +165,6 @@ async def test_composition_of_vertical_container_with_children(
@pytest.mark.asyncio
@pytest.mark.integration_test
@pytest.mark.parametrize(
"edge_type,expected_box_inner_size,expected_box_size,expected_top_left_edge_color,expects_visible_char_at_top_left_edge",
(