mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
* tabs widget * click underline * color tweak * docs * docs update * expose Tab * added remove_tab and clear * fix cycling * add animation * docs * changelog * remove recompose * docstrings * Update docs/guide/actions.md Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Rodrigoed the tabs * Update docs/widgets/tabs.md Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Update docs/widgets/tabs.md Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * copy * docstrings * docstring * docstring * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * stop click * docstring * auto assign consistent IDs * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Document bindings * document bindings * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com> --------- Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
17 lines
393 B
Python
17 lines
393 B
Python
from textual import events
|
|
from textual.app import App
|
|
|
|
|
|
class ActionsApp(App):
|
|
def action_set_background(self, color: str) -> None:
|
|
self.screen.styles.background = color
|
|
|
|
async def on_key(self, event: events.Key) -> None:
|
|
if event.key == "r":
|
|
await self.run_action("set_background('red')")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app = ActionsApp()
|
|
app.run()
|