Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: generalize list items #979

Open
voodookiidoo opened this issue Apr 30, 2024 · 0 comments
Open

Feature request: generalize list items #979

voodookiidoo opened this issue Apr 30, 2024 · 0 comments

Comments

@voodookiidoo
Copy link

Currently, tview.List is based around text and secondary text.
But if you need to store a list of items and keep their representation valid - you have to keep a list of some items somewhere else, and keep track of their order. What about adding a CustomList (call it how you want), where instead of using plain text for items, use an interface like

type interface ListItem {
GetText() string
GetSecondaryText() string
GetRune() rune
GetSelectionFunction() func()
}

That would make maintaining both data and it's view much easier!
(I implemented it in my fork of your lib, can show you if you'd like to)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant