You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm making a simple TUI application that displays a fixed header, footer, and some content. I already love how Rich sanely handles overflow in the content section (compared to ncurses which usually just crashes). It consists of a 3 panel layout in a Live.
Is there any easy way to display an ellipsis in an overflowing Layout?. I tried making a basic superclass, LayoutOverflow:
...but most of the obvious looking functions such as render, refresh_screen, and __rich_console__ aren't called - I think the parent Layout does all the rendering work. I tried looking into how Layout._make_region_map works but it's fairly intertwined with the rendering system that I don't really understand.
I tried printing layout['content'].map in my Live render loop, but it's always an empty dict. layout.map is full of information, but it only contains the size of the rendered viewport, not the required viewport.
LiveRender.__rich_console__ seems to have a very elegant implementation of overflow, is there any easy way to get a Layout's minimum size?
I also looked into Textual as it has beautiful scrollbars, but it seems a bit heavy as my TUI has no interaction.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm making a simple TUI application that displays a fixed header, footer, and some content. I already love how Rich sanely handles overflow in the content section (compared to ncurses which usually just crashes). It consists of a 3 panel layout in a
Live
.Is there any easy way to display an ellipsis in an overflowing
Layout
?. I tried making a basic superclass,LayoutOverflow
:...but most of the obvious looking functions such as
render
,refresh_screen
, and__rich_console__
aren't called - I think the parentLayout
does all the rendering work. I tried looking into howLayout._make_region_map
works but it's fairly intertwined with the rendering system that I don't really understand.I tried printing
layout['content'].map
in my Live render loop, but it's always an empty dict.layout.map
is full of information, but it only contains the size of the rendered viewport, not the required viewport.LiveRender.__rich_console__
seems to have a very elegant implementation of overflow, is there any easy way to get a Layout's minimum size?I also looked into Textual as it has beautiful scrollbars, but it seems a bit heavy as my TUI has no interaction.
Beta Was this translation helpful? Give feedback.
All reactions