Move the tutorial over to using ScrollableContainer

This commit is contained in:
Dave Pearson
2023-04-24 13:13:11 +01:00
parent ca94c5eed0
commit 2055a8996f
7 changed files with 21 additions and 21 deletions

View File

@@ -1,9 +1,9 @@
from time import monotonic
from textual.app import App, ComposeResult
from textual.containers import Container
from textual.containers import ScrollableContainer
from textual.reactive import reactive
from textual.widgets import Button, Header, Footer, Static
from textual.widgets import Button, Footer, Header, Static
class TimeDisplay(Static):
@@ -83,7 +83,7 @@ class StopwatchApp(App):
"""Called to add widgets to the app."""
yield Header()
yield Footer()
yield Container(Stopwatch(), Stopwatch(), Stopwatch(), id="timers")
yield ScrollableContainer(Stopwatch(), Stopwatch(), Stopwatch(), id="timers")
def action_add_stopwatch(self) -> None:
"""An action to add a timer."""

View File

@@ -1,6 +1,6 @@
from textual.app import App, ComposeResult
from textual.containers import Container
from textual.widgets import Button, Header, Footer, Static
from textual.containers import ScrollableContainer
from textual.widgets import Button, Footer, Header, Static
class TimeDisplay(Static):
@@ -27,7 +27,7 @@ class StopwatchApp(App):
"""Create child widgets for the app."""
yield Header()
yield Footer()
yield Container(Stopwatch(), Stopwatch(), Stopwatch())
yield ScrollableContainer(Stopwatch(), Stopwatch(), Stopwatch())
def action_toggle_dark(self) -> None:
"""An action to toggle dark mode."""

View File

@@ -1,6 +1,6 @@
from textual.app import App, ComposeResult
from textual.containers import Container
from textual.widgets import Button, Header, Footer, Static
from textual.containers import ScrollableContainer
from textual.widgets import Button, Footer, Header, Static
class TimeDisplay(Static):
@@ -28,7 +28,7 @@ class StopwatchApp(App):
"""Create child widgets for the app."""
yield Header()
yield Footer()
yield Container(Stopwatch(), Stopwatch(), Stopwatch())
yield ScrollableContainer(Stopwatch(), Stopwatch(), Stopwatch())
def action_toggle_dark(self) -> None:
"""An action to toggle dark mode."""

View File

@@ -1,6 +1,6 @@
from textual.app import App, ComposeResult
from textual.containers import Container
from textual.widgets import Button, Header, Footer, Static
from textual.containers import ScrollableContainer
from textual.widgets import Button, Footer, Header, Static
class TimeDisplay(Static):
@@ -35,7 +35,7 @@ class StopwatchApp(App):
"""Create child widgets for the app."""
yield Header()
yield Footer()
yield Container(Stopwatch(), Stopwatch(), Stopwatch())
yield ScrollableContainer(Stopwatch(), Stopwatch(), Stopwatch())
def action_toggle_dark(self) -> None:
"""An action to toggle dark mode."""

View File

@@ -1,9 +1,9 @@
from time import monotonic
from textual.app import App, ComposeResult
from textual.containers import Container
from textual.containers import ScrollableContainer
from textual.reactive import reactive
from textual.widgets import Button, Header, Footer, Static
from textual.widgets import Button, Footer, Header, Static
class TimeDisplay(Static):
@@ -55,7 +55,7 @@ class StopwatchApp(App):
"""Create child widgets for the app."""
yield Header()
yield Footer()
yield Container(Stopwatch(), Stopwatch(), Stopwatch())
yield ScrollableContainer(Stopwatch(), Stopwatch(), Stopwatch())
def action_toggle_dark(self) -> None:
"""An action to toggle dark mode."""

View File

@@ -1,9 +1,9 @@
from time import monotonic
from textual.app import App, ComposeResult
from textual.containers import Container
from textual.containers import ScrollableContainer
from textual.reactive import reactive
from textual.widgets import Button, Header, Footer, Static
from textual.widgets import Button, Footer, Header, Static
class TimeDisplay(Static):
@@ -78,7 +78,7 @@ class StopwatchApp(App):
"""Called to add widgets to the app."""
yield Header()
yield Footer()
yield Container(Stopwatch(), Stopwatch(), Stopwatch())
yield ScrollableContainer(Stopwatch(), Stopwatch(), Stopwatch())
def action_toggle_dark(self) -> None:
"""An action to toggle dark mode."""