Ensure we log any OptionList messages in the messages test

We don't actually want to see them, we don't expect to see them, so here I
make a point of logging them so we can be sure we *don't* see them.
This commit is contained in:
Dave Pearson
2023-05-24 09:09:40 +01:00
parent 50d77b231f
commit 56103c52e7

View File

@@ -11,7 +11,7 @@ from __future__ import annotations
from textual import on from textual import on
from textual.app import App, ComposeResult from textual.app import App, ComposeResult
from textual.messages import Message from textual.messages import Message
from textual.widgets import SelectionList from textual.widgets import OptionList, SelectionList
class SelectionListApp(App[None]): class SelectionListApp(App[None]):
@@ -24,6 +24,8 @@ class SelectionListApp(App[None]):
def compose(self) -> ComposeResult: def compose(self) -> ComposeResult:
yield SelectionList[int](*[(str(n), n) for n in range(10)]) yield SelectionList[int](*[(str(n), n) for n in range(10)])
@on(OptionList.OptionHighlighted)
@on(OptionList.OptionSelected)
@on(SelectionList.SelectionHighlighted) @on(SelectionList.SelectionHighlighted)
@on(SelectionList.SelectionToggled) @on(SelectionList.SelectionToggled)
@on(SelectionList.SelectedChanged) @on(SelectionList.SelectedChanged)