pub fn new(
        text: impl Into<LabelText<T>>,
        action: fn(&mut EventCtx<T>, &mut T, &Env), ////
        ////action: impl Fn(&mut EventCtx, &mut T, &Env) + 'static,
    ) -> Button<T> {
        Button {
            id: super::get_widget_id(), ////
            label: Label::aligned(text, UnitPoint::CENTER),
            action, ////
            ////action: Box::new(action),
        }
    }
////
////impl<T: Data + 'static> Button<T> {
/// Create a new button. The closure provided will be called when the button
/// is clicked.
impl Button {
Create a new button. The closure provided will be called when the button
is clicked.
impl Button { Create a new button . The closure provided will be called when the button is clicked .
pub fn new(
        text: impl Into<LabelText<T>>,
        action: fn(&mut EventCtx<T>, &mut T, &Env), ////
        ////action: impl Fn(&mut EventCtx, &mut T, &Env) + 'static,
    ) -> Button<T> {
        Button {
            id: super::get_widget_id(), ////
            label: Label::aligned(text, UnitPoint::CENTER),
            action, ////
            ////action: Box::new(action),
        }
    }
pub fn new ( text : impl Into < LabelText < T > > , action : fn ( & mut EventCtx < T > , & mut T , & Env ) , //// ////action: impl Fn(&mut EventCtx, &mut T, &Env) + 'static, ) -> Button < T > { Button { id : super :: get_widget_id ( ) , //// label : Label :: aligned ( text , UnitPoint :: CENTER ) , action , //// ////action: Box::new(action), } }
impl<T: Data + 'static> Button<T> {
Create a new button.
impl<T : Data + ' static > Button<T > { Create a new button .
text
impl Into<LabelText<T>>
action
fn(&mut EventCtx<T>, &mut T, &Env)
text
impl Into<LabelText<T>>
action
fn(&mut EventCtx<T>, &mut T, &Env)