First, I had to copy the Padding widget and change its child type to AnyWidget, otherwise I could not call mutate_update. So I don't think we can use any of Druids container widgets that use WidgetPod<dyn Widget<T>> for their child.
Second, I had to find a way to deal with the fact that the Crochet style of writing the UI does not offer a good way to deal with single child containers. For simplicity, I chose to allow multiple children and just warn about it, then only apply events to the first child.
There are two interesting things about this:
First, I had to copy the
Padding
widget and change its child type toAnyWidget
, otherwise I could not callmutate_update
. So I don't think we can use any of Druids container widgets that useWidgetPod<dyn Widget<T>>
for their child.Second, I had to find a way to deal with the fact that the Crochet style of writing the UI does not offer a good way to deal with single child containers. For simplicity, I chose to allow multiple children and just warn about it, then only apply events to the first child.