Skip to content
Discussion options

You must be logged in to vote

Almost, although you've made it a bit more complicated than it needs to be. WelcomeScreen.on_mount can just be this:

def on_mount(self):
    self.set_timer(0.8, self.app.pop_screen)

For example:

from textual.app import App, ComposeResult
from textual.screen import Screen
from textual.widgets import Label

class Welcome(Screen):

    def compose(self) -> ComposeResult:
        yield Label("WELCOME!")

    def on_mount(self) -> None:
        self.set_timer(0.8, self.app.pop_screen)

class WelcomeScreenApp(App[None]):

    def compose(self) -> ComposeResult:
        yield Label("This is the main screen, you'll see it in a second")

    def on_mount(self) -> None:
        self.push_screen(Wel…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@davep
Comment options

Answer selected by anzhi0708
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants