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

on_select for ListView #94

Closed
Ameobea opened this issue Jan 10, 2017 · 2 comments
Closed

on_select for ListView #94

Ameobea opened this issue Jan 10, 2017 · 2 comments

Comments

@Ameobea
Copy link
Contributor

Ameobea commented Jan 10, 2017

In my application, I'd like to have some explanatory text be displayed depending on the selected element in a ListView. However, it seems that no functionality exists to register a callback for this or even access the focused element of a given ListView (focus is private).

I'd be happy to implement this myself and create a PR. I'd add on_select and set_on_select methods to ListView (similar to that of SelectView) and perhaps expose a get_focused(&self) -> usize to get the currently focused element.

Would this be something that you'd be willing to accept?

@gyscos
Copy link
Owner

gyscos commented Jan 11, 2017

Absolutely, I'm not sure why I didn't include one already.
get_focused(&self) -> usize could be named focus, like its version in SelectView.

@Ameobea
Copy link
Contributor Author

Ameobea commented Jan 11, 2017

Resolved in 9894dd9

@Ameobea Ameobea closed this as completed Jan 11, 2017
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

2 participants