Skip to content

Is there any way to get the height of a panel programmatically? #1767

Closed Answered by willmcgugan
ZeroIntensity asked this question in Q&A
Discussion options

You must be logged in to vote

The Panel.height is used to force the height in advance. It's not to report the height as it is rendered.

If you want to know the available height within a Panel you can define a console renderable with a __rich_console__ method. See the docs for how to define a console renderable. The options parameter will have a max_height attribute which is the number of lines available.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ZeroIntensity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants