Horizontal scrollbar doesn't display #2198
Answered
by
willmcgugan
davidbrochart
asked this question in
Q&A
-
I'm struggling to get vertical and horizontal scrollbars with this example, where only a vertical scrollbar is displayed: from textual.app import App, ComposeResult
from textual.widgets import Static
class MyStatic(Static):
def __init__(self):
content = "\n".join([f"{i} " * 200 for i in range(200)])
super().__init__(content)
class MyApp(App):
DEFAULT_CSS = """
MyStatic {
overflow: auto auto;
width: auto;
height: auto;
}
"""
def compose(self) -> ComposeResult:
yield MyStatic()
if __name__ == "__main__":
app = MyApp()
app.run() Any idea? |
Beta Was this translation helpful? Give feedback.
Answered by
willmcgugan
Apr 2, 2023
Replies: 1 comment 1 reply
-
When you want something to scroll its the Try setting this in your css: Screen {
overflow: auto auto;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
davidbrochart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you want something to scroll its the
overflow
of the container which is important. In your code the container of the static is the screen.Try setting this in your css: