mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
words
This commit is contained in:
@@ -353,7 +353,7 @@ Some of the new styles have more than one selector separated by a space. The spa
|
||||
```
|
||||
|
||||
The `.started` selector matches any widget with a `"started"` CSS class.
|
||||
While `#start` matches a child widget with an ID of `"start"`.
|
||||
While `#start` matches a widget with an ID of `"start"`.
|
||||
Combining the two selectors with a space (`.started #start`) creates a new selector that will match the start button *only* if it is also inside a container with a CSS class of "started".
|
||||
|
||||
As before, the `display: none` rule will cause any matching widgets to be hidden from view.
|
||||
@@ -377,6 +377,8 @@ The `on_button_pressed` method is an *event handler*. Event handlers are methods
|
||||
Event handlers begin with `on_` followed by the name of the event they will handle.
|
||||
Hence `on_button_pressed` will handle the button pressed event.
|
||||
|
||||
See the guide on [message handlers](./guide/events.md#message-handlers) for the details on how to write event handlers.
|
||||
|
||||
If you run `stopwatch04.py` now you will be able to toggle between the two states by clicking the first button:
|
||||
|
||||
```{.textual path="docs/examples/tutorial/stopwatch04.py" title="stopwatch04.py" press="tab,tab,tab,enter"}
|
||||
|
||||
Reference in New Issue
Block a user