Add 'boxed()' fn to WidgetExt
* Extend WidgetExt Trait
using a handy utility function to quickly get `Box`es from Widgets
* Documentation update
Extend DocComments for WidgetExt::boxed method
@@ -139,6 +139,11 @@ pub trait WidgetExt<T: Data>: Widget<T> + Sized + 'static {
{
Parse::new(self)
}
+
+ /// Wrap this widget in a `Box`.
+ fn boxed(self) -> Box<dyn Widget<T>> {
+ Box::new(self)
+ }
}
impl<T: Data, W: Widget<T> + 'static> WidgetExt<T> for W {}
