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

Custom widget that contains self-generated child widgets #709

Closed
edko99 opened this issue Jan 21, 2021 · 2 comments
Closed

Custom widget that contains self-generated child widgets #709

edko99 opened this issue Jan 21, 2021 · 2 comments
Labels
layout performance question Further information is requested widget
Milestone

Comments

@edko99
Copy link

edko99 commented Jan 21, 2021

I am trying to implement a widget to display an interactive list of items. I though of using Row widgets to layout the internal content, and to capture and respond to events. However, these row widgets will not be added by the user, but rather be generated internally by the List widget. Since my list can be very big, I would like to use virtual scrolling and recycle the rows. Should they be part of the List's state? Should I generate them on the fly when layout is called? What should I do if the user resizes the window and I need to add more rows? Is there an example I can use for inspiration?

@13r0ck
Copy link
Contributor

13r0ck commented Jan 21, 2021

What should I do if the user resizes the window and I need to add more rows?
I am not sure about the first part of your question, but maybe for the later, wrap it in a pane grid then use the resize event?
https://docs.rs/iced/0.2.0/iced/widget/pane_grid/struct.ResizeEvent.html

@hecrj hecrj added the question Further information is requested label Jan 24, 2021
@hecrj hecrj added this to the 0.3.0 milestone Jan 24, 2021
@hecrj hecrj modified the milestones: 0.3.0, 0.4.0 Mar 31, 2021
@hecrj
Copy link
Member

hecrj commented Jan 20, 2022

Duplicate of #160. Feel free to tell us more about your use case there for further discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
layout performance question Further information is requested widget
Projects
None yet
Development

No branches or pull requests

3 participants