(self)
| 7 | CSS_PATH = "button.tcss" |
| 8 | |
| 9 | def compose(self) -> ComposeResult: |
| 10 | yield Horizontal( |
| 11 | VerticalScroll( |
| 12 | Static("Standard Buttons", classes="header"), |
| 13 | Button("Default"), |
| 14 | Button("Primary!", variant="primary"), |
| 15 | Button.success("Success!"), |
| 16 | Button.warning("Warning!"), |
| 17 | Button.error("Error!"), |
| 18 | ), |
| 19 | VerticalScroll( |
| 20 | Static("Disabled Buttons", classes="header"), |
| 21 | Button("Default", disabled=True), |
| 22 | Button("Primary!", variant="primary", disabled=True), |
| 23 | Button.success("Success!", disabled=True), |
| 24 | Button.warning("Warning!", disabled=True), |
| 25 | Button.error("Error!", disabled=True), |
| 26 | ), |
| 27 | VerticalScroll( |
| 28 | Static("Flat Buttons", classes="header"), |
| 29 | Button("Default", flat=True), |
| 30 | Button("Primary!", variant="primary", flat=True), |
| 31 | Button.success("Success!", flat=True), |
| 32 | Button.warning("Warning!", flat=True), |
| 33 | Button.error("Error!", flat=True), |
| 34 | ), |
| 35 | VerticalScroll( |
| 36 | Static("Disabled Flat Buttons", classes="header"), |
| 37 | Button("Default", disabled=True, flat=True), |
| 38 | Button("Primary!", variant="primary", disabled=True, flat=True), |
| 39 | Button.success("Success!", disabled=True, flat=True), |
| 40 | Button.warning("Warning!", disabled=True, flat=True), |
| 41 | Button.error("Error!", disabled=True, flat=True), |
| 42 | ), |
| 43 | ) |
| 44 | |
| 45 | def on_button_pressed(self, event: Button.Pressed) -> None: |
| 46 | self.exit(str(event.button)) |
nothing calls this directly
no test coverage detected