Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Why can't we use a Vec<Text> or something for lists? #93

Closed
jrmiller82 opened this issue Nov 25, 2018 · 2 comments
Closed

Why can't we use a Vec<Text> or something for lists? #93

jrmiller82 opened this issue Nov 25, 2018 · 2 comments

Comments

@jrmiller82
Copy link

I'm getting all sorts of compiler puke when trying to use the List and SelectableList widgets. It's looking like the library requires me to use a fixed array to give to List or SelectableList. Why can't I use a vec? This makes it a PITA when dealing with dynamic UI lists.

@fdehau
Copy link
Owner

fdehau commented Nov 25, 2018

List and SelectableList require an Iterator as illustrated here:

let events = app.events.iter().map(|&(evt, level)| {
. Have you tried to call iter() on your Vec ? What was your error ?

@fdehau fdehau reopened this Nov 25, 2018
@fdehau fdehau closed this as completed Nov 25, 2018
@jrmiller82
Copy link
Author

jrmiller82 commented Dec 3, 2018

I had an iterator, but it was an iterator coming from Vec<String> instead of Vec<&str>. I think the functions need to eventually also accept a Vec<String>.iter() instead of only a Vec<&str>.iter(). But I figured out how to get it to work in the meantime.

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

No branches or pull requests

2 participants