File size: 552 Bytes
2c3c408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from rich.text import Text
from textual.app import App, ComposeResult
from textual.widgets import Static

text = "\n".join("FOO BAR bazz etc sdfsdf " * 20 for n in range(1000))


class Content(Static):
    DEFAULT_CSS = """
    Content {
        width: auto;
    }
    """

    def render(self):
        return Text(text, no_wrap=False)


class ScrollApp(App):
    CSS = """
    Screen {
        overflow: auto;
    }
    """

    def compose(self) -> ComposeResult:
        yield Content()


app = ScrollApp()
if __name__ == "__main__":
    app.run()