accidental check in

This commit is contained in:
Will McGugan
2022-12-27 13:03:46 +00:00
parent 3fd8fe2210
commit ac0acde81e

View File

@@ -1,36 +0,0 @@
from textual.app import App, ComposeResult
from textual.widget import Widget
from textual.widgets import Button, Footer
class MyWidget(Widget):
def __init__(self):
self.button = Button()
super().__init__()
def compose(self) -> ComposeResult:
yield self.button
class MyApp(App):
BINDINGS = [("s", "show_button", "Show Button")]
def __init__(self):
self.my_widget = None
super().__init__()
def compose(self) -> ComposeResult:
yield Footer()
async def action_show_button(self) -> None:
if self.my_widget is None:
self.my_widget = MyWidget()
else:
await self.my_widget.remove()
await self.mount(self.my_widget)
if __name__ == "__main__":
app = MyApp()
app.run()