-
I have a |
Beta Was this translation helpful? Give feedback.
Answered by
davep
Mar 13, 2024
Replies: 1 comment 1 reply
-
OK I think I just figured it out from textual.app import App, ComposeResult
from textual.screen import Screen
from textual.widgets import Label, Button, Input
from textual.containers import Center, Middle, Vertical, Horizontal
from textual.message_pump import MessagePump
msg_pump = MessagePump()
class WelcomeScreen(Screen):
def compose(self):
with Center():
with Middle():
yield Label("Welcome")
def on_mount(self):
timer = msg_pump.set_timer(0.8, callback=lambda: self.app.pop_screen()) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Almost, although you've made it a bit more complicated than it needs to be.
WelcomeScreen.on_mount
can just be this:For example: