Sizing specific-width text to the width of a ScrollView #444
-
So I have this Pytest plugin that takes the console output from a test run and displays it within a TUI. The output, as formatted by Pytest, fits the width of the terminal, so you end up with something nice like:
At the end of the session I have access to this text, but when it comes time to display it in the TUI (which I am doing with a ScrollView widget), thee borders and scrollbar of the ScrollView end up taking a few characters of width, so when I print it there there isn't quite enough room for the specific width of the output and I end up with unattractive wraparounds happening: Is there a way to render the ScrollView object so that it takes up zero extra width on the screen? Or will I need to play some fancy games with the console output to make it fit without wrapping? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sometimes just the act of asking a question in public spurs me on to figure things out for myself. Turns out you can instantiate the ScrollView with |
Beta Was this translation helpful? Give feedback.
Sometimes just the act of asking a question in public spurs me on to figure things out for myself. Turns out you can instantiate the ScrollView with
auto_width=True
, and that gives me what I want.