How to display dynamic ordered content? #3319
Replies: 2 comments
-
You might want to look back over the Textual tutorial, especially at the part about dynamic widgets; |
Beta Was this translation helpful? Give feedback.
-
Ok, I think the terminology of "mount" is confusing; I haven't seen this in any other UI framework I've worked with. There are several methods using "child" in the terminology, I think it would be helpful to have a public method add_child alias for the mount() method. Of course if Tree and List had a way to add an entry by index, that would be helpful as well. 😄 |
Beta Was this translation helpful? Give feedback.
-
I'm porting an app I wrote in tkinter and running into some issues. Neither Tree nor ListView seem to support inserting items into the middle of the list or sorting in general. I am communicating with a device and receiving information at runtime, so it is not possible to know this at the time "compose" is run.
I thought about creating a Vertical Scroll container, then adding a collapsible Container of labels. There's a couple issues though. Adding to the containers use a compose function (which seems risky to call this outside of
compose()
), and is always to the end; I'd rather not add it to the end and then move it, why not just specify the index when I am inserting?I suppose the only control capable of doing this is the Data Table? Or just format the text as a blob and put it into a non-editable text box?
When inserting things into the list, the container has to be redrawn, and it may affect things like scroll bars, currently selected item, etc... So I realize it's not exactly trivial; just wondering if there was something I'm missing at a higher level.
Beta Was this translation helpful? Give feedback.
All reactions