Make on_mount callback customizable
Introduce the ability to customize the on_mount callback of the underlying Textual App. By allowing users to specify the on_mount behavior, they can define their own logic for the application's mount phase. For example, users can change the default theme of the generated Trogon app.
I wasn't entirely sure if this behavior could be achieved in a different way, so I implemented it using the on_mount callback. However, I'm open to adjust the implementation if there's a more idiomatic or better approach to achieve the same result.
Example: Change default theme
def on_mount(app: App):
app.theme = 'tokyo-night'
@tui(on_mount=on_mount)
@click.command()
def hello_world():
"""Prints 'Hello world'."""
click.echo('Hello world.')
Thanks for your patience here @gitseti. I recognize that the on_mount entry point might be useful for a variety of reasons. That said, I know that the theme in particular can be altered by setting the TEXTUAL_THEME environment variable already, and I would like to hear from you or others some additional use cases around customizing on_mount to determine whether it feels worth taking on this customization as an additional moving part!