mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add control to RadioSet message.
This commit is contained in:
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- `DirectoryTree.FileSelected`
|
||||
- `ListView.Highlighted` and `ListView.Selected`
|
||||
- `Markdown.TableOfContentsUpdated`, `Markdown.TableOfContentsSelected`, and `Markdown.LinkClicked`
|
||||
- `RadioSet.Changed`
|
||||
|
||||
## [0.23.0] - 2023-05-03
|
||||
|
||||
|
||||
@@ -92,6 +92,15 @@ class RadioSet(Container, can_focus=True, can_focus_children=False):
|
||||
self.index = radio_set.pressed_index
|
||||
"""The index of the [`RadioButton`][textual.widgets.RadioButton] that was pressed to make the change."""
|
||||
|
||||
@property
|
||||
def control(self) -> RadioSet:
|
||||
"""A reference to the [`RadioSet`][textual.widgets.RadioSet] that was changed.
|
||||
|
||||
This is an alias for [`Changed.radio_set`][textual.widgets.RadioSet.Changed.radio_set]
|
||||
and is used by the [`on`][textual.on] decorator.
|
||||
"""
|
||||
return self.radio_set
|
||||
|
||||
def __rich_repr__(self) -> rich.repr.Result:
|
||||
yield "radio_set", self.radio_set
|
||||
yield "pressed", self.pressed
|
||||
|
||||
Reference in New Issue
Block a user