Replies: 2 comments
-
Oh, I forgot to add my sample code: from rich import print
from rich.layout import Layout
from rich.panel import Panel
layout = Layout()
p1 = Panel("Hello " * 75)
p2 = Panel("World " * 100)
p1.expand = True # Does only apply to width
p2.expand = True
p1.height = 10
layout.split_row(
Layout(p1),
Layout(p2)
)
layout.size = 15
print(layout) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think the only way to do that would be to set the panel height to Consider using Textual if you want more advanced layout than that. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Thanks for the great work on the library!
One question:
I would like to create a simple layout with two panels side by side. They should each fit their content in height, and half of the terminal width.
However, when I them to a layout, their height is expanded to the entire height of the terminal.
I found the
.expand = True
parameter but that is only for width. And if I force them with.height = 10
they still get placed in the top of the available space, just with empty space below.So is there a way to prevent the layout from filling the screen?
Test code:
Beta Was this translation helpful? Give feedback.
All reactions