Merge pull request #958 from davep/toll-free

Review the use of the bell in various examples and documentation files
This commit is contained in:
Dave Pearson
2022-10-19 15:56:21 +01:00
committed by GitHub
14 changed files with 5 additions and 55 deletions

View File

@@ -5,7 +5,6 @@ from textual import events
class ActionsApp(App):
def action_set_background(self, color: str) -> None:
self.screen.styles.background = color
self.bell()
def on_key(self, event: events.Key) -> None:
if event.key == "r":

View File

@@ -5,7 +5,6 @@ from textual import events
class ActionsApp(App):
def action_set_background(self, color: str) -> None:
self.screen.styles.background = color
self.bell()
async def on_key(self, event: events.Key) -> None:
if event.key == "r":

View File

@@ -15,7 +15,6 @@ class ActionsApp(App):
def action_set_background(self, color: str) -> None:
self.screen.styles.background = color
self.bell()
if __name__ == "__main__":

View File

@@ -21,7 +21,6 @@ class ActionsApp(App):
def action_set_background(self, color: str) -> None:
self.screen.styles.background = color
self.bell()
if __name__ == "__main__":

View File

@@ -28,7 +28,6 @@ class ActionsApp(App):
def action_set_background(self, color: str) -> None:
self.screen.styles.background = color
self.bell()
if __name__ == "__main__":

View File

@@ -12,9 +12,6 @@ class InputApp(App):
def on_key(self, event: events.Key) -> None:
self.query_one(TextLog).write(event)
def key_space(self) -> None:
self.bell()
if __name__ == "__main__":
app = InputApp()

View File

@@ -1,9 +0,0 @@
from textual.app import App
class ExampleApp(App):
pass
app = ExampleApp()
app.run()

View File

@@ -1,29 +0,0 @@
from textual.app import App
class ExampleApp(App):
COLORS = [
"white",
"maroon",
"red",
"purple",
"fuchsia",
"olive",
"yellow",
"navy",
"teal",
"aqua",
]
def on_mount(self):
self.styles.background = "darkblue"
def on_key(self, event):
if event.key.isdigit():
self.styles.background = self.COLORS[int(event.key)]
self.bell()
app = ExampleApp()
app.run()

View File

@@ -27,7 +27,6 @@ class ButtonsApp(App[str]):
)
def on_button_pressed(self, event: Button.Pressed) -> None:
self.app.bell()
self.exit(str(event.button))