pub fn add_listener<F, W>(&mut self, listener: F)
    where
        W: View,
        F: 'static + Fn(&mut W, &mut Context, &mut Event),
    {
        self.listeners.insert(
            self.current,
            Box::new(move |event_handler, context, event| {
                if let Some(widget) = event_handler.downcast_mut::<W>() {
                    (listener)(widget, context, event);
                }
            }),
        );
    }
/// Add a listener to an entity.
///
/// A listener can be used to handle events which would not normally propagate to the entity.
/// For example, mouse events when a different entity has captured them. Useful for things like
/// closing a popup when clicking outside of its bounding box.
Add a listener to an entity.
A listener can be used to handle events which would not normally propagate to the entity.
For example, mouse events when a different entity has captured them. Useful for things like
closing a popup when clicking outside of its bounding box.
Add a listener to an entity . A listener can be used to handle events which would not normally propagate to the entity . For example mouse events when a different entity has captured them . Useful for things like closing a popup when clicking outside of its bounding box .
pub fn add_listener<F, W>(&mut self, listener: F)
    where
        W: View,
        F: 'static + Fn(&mut W, &mut Context, &mut Event),
    {
        self.listeners.insert(
            self.current,
            Box::new(move |event_handler, context, event| {
                if let Some(widget) = event_handler.downcast_mut::<W>() {
                    (listener)(widget, context, event);
                }
            }),
        );
    }
pub fn add_listener < F , W > ( & mut self , listener : F ) where W : View , F : ' static + Fn ( & mut W , & mut Context , & mut Event ) , { self . listeners . insert ( self . current , Box :: new ( move | event_handler , context , event | { if let Some ( widget ) = event_handler . downcast_mut :: < W > ( ) { ( listener ) ( widget , context , event ) ; } } ) , ) ; }
Add a listener to an entity.
Add a listener to an entity .
&mut self
listener
F