textual
textual copied to clipboard
Need layout usage example
Hi! I failed at creating a widget with complex content using textual. What would help me is an example of how one do something like this:
My try at it was:
class PlayerWidget(Widget):
def render(self) -> RenderableType:
layout = VerticalLayout()
layout.add(Static(Align.left(Text("FIRST LINE"))))
layout.add(Static(Align.left(Text("SECOND LINE"))))
return Panel(
layout,
title='Player',
border_style="green",
height=10,
)
You may find this useful. I found this when I was looking for examples myself. The link refers to part 3 of the tutorial but parts 1 and 2 are worth taking a look as well. https://dev.to/wiseai/textual-the-definitive-guide-part-3-2gl
Thanks, I read the tutorial. Unfortunately I still can't get closer to understanding of what should be done in my case.
Writing on behalf of the devottys =) https://github.com/devottys. I love the terminal, and I really love tools that are going to mean more TUI apps.
When we played with Textual, we liked how much easier it was to build panels, but wanted something akin to a curses-like interface to place things within panels. With the goal of being able to play with the layout.
https://github.com/Textualize/textual/wiki/Sorry-we-closed-your-issue
Did we solve your problem?
Glad we could help!