I'm trying to create a list of widgets, which are dynamically created in response to user actions. It doesn't seem like there's a way to create widgets on the fly, is there?
Ideally, I'd like to be able to do something like:
list_box.append(Widget::new())
I know that relm::create_component<T> exists, but it's difficult to use in the above context, as list_box above accepts a reference to the created component/widget, but the owning handle goes out of scope quickly, while the list_box hangs around much longer.
Hi there,
I'm trying to create a list of widgets, which are dynamically created in response to user actions. It doesn't seem like there's a way to create widgets on the fly, is there?
Ideally, I'd like to be able to do something like:
I know that
relm::create_component<T>
exists, but it's difficult to use in the above context, aslist_box
above accepts a reference to the created component/widget, but the owning handle goes out of scope quickly, while thelist_box
hangs around much longer.