Looking for a robust listbox replacement for the one I wrote ages ago #4030
Replies: 2 comments
-
Yes indeed. https://github.com/gui-cs/Terminal.Gui/blob/v2_develop/Terminal.Gui%2FViews%2FListView.cs#L43 ListView in v2 is built to show an IObservableList You could use element T being a stateful object. From your list, I think the only thing missing is 'Disabled' items. You would need to write event handler for keys like Delete - but just have to wire up to remove from the backing list collection. We also have:
For color, you would need to implement draw handler for the list items. I.e. implement the We also have
If you need child items and/or multiple columns of data TableView can also be set up to work like a list: |
Beta Was this translation helpful? Give feedback.
-
I'll have a look at it then, thanks! |
Beta Was this translation helpful? Give feedback.
-
About 10 years ago, I started writing my own console listbox control in C#. It worked great with Windows 7's conhost, but it's not playing too well with Window 11's new terminal due to how I rely on
Console.WindowWidth
and other dimensional properties to dynamically size the list control. I am looking for a replacement, but can't find any that support all of the same features as mine. Here are some of the features off the top of my head:ListItem<T>
which contains state info that you can retrieve vialistbox.GetSelectedItem()
Does Terminal.Gui have a list control that supports these features? If not, would it be relatively straightforward for a new contributor such as myself to implement them?
Beta Was this translation helpful? Give feedback.
All reactions