textual icon indicating copy to clipboard operation
textual copied to clipboard

ListView from ScrollView

Open styk-tv opened this issue 2 years ago • 3 comments

Hi @willmcgugan. I'd like to open this issue a s a means of tracking one of the backlog items. Maybe there are more people interested in this feature. After days of trying I was unable to do it myself.

Screenshot 2022-03-15 at 06 40 40

I was not able to find a way to create a scrollable list that could overflow out of screen with a nice scroll bar. ezgif com-gif-maker

DirectoryTree was my main inspiration but I couldn't find a way to make it dockable like this: ezgif com-gif-maker (1)

        await self.view.dock(
            ScrollView(self.directory), edge="left", size=48, name="sidebar"
        )

It would be great to make the new ListView for example to contain a list of object, then bind a property like name to display something visible and then on selection to be able simply pass itself (full object) to another destination panel.

Anyone can share some ideas/tips on how to proceed or what to try?

styk-tv avatar Mar 15 '22 07:03 styk-tv

We're working on a branch which will make these kind of things easier to create. And there will likely be a builtin list view.

I'm afraid I can't help you much with this right now. But we will be maintaining the 0.1 branch for a while, so you could maybe build this is a third party lib?

willmcgugan avatar Mar 15 '22 08:03 willmcgugan

Something like this was discussed in https://github.com/Textualize/textual/discussions/196 I believe

wasi-master avatar Mar 19 '22 11:03 wasi-master

thanks @cvaniak and for the demo and thanks @wasi-master for ping on the solution

styk-tv avatar Apr 12 '22 11:04 styk-tv

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]