textual icon indicating copy to clipboard operation
textual copied to clipboard

Need layout usage example

Open senyai opened this issue 2 years ago • 3 comments

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: window

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,
        )

senyai avatar Jun 23 '22 14:06 senyai

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

Hakobkhh avatar Jun 28 '22 21:06 Hakobkhh

Thanks, I read the tutorial. Unfortunately I still can't get closer to understanding of what should be done in my case.

senyai avatar Jul 06 '22 11:07 senyai

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.

anjakefala avatar Aug 22 '22 04:08 anjakefala

https://github.com/Textualize/textual/wiki/Sorry-we-closed-your-issue

willmcgugan avatar Oct 25 '22 09:10 willmcgugan

Did we solve your problem?

Glad we could help!

github-actions[bot] avatar Oct 25 '22 09:10 github-actions[bot]