abuse macros..
This commit is contained in:
@@ -116,11 +116,12 @@ impl<State: 'static, E: Event> TypeEventManager<State, E> {
|
||||
self.map.entry(widget.id()).or_default().push((
|
||||
event,
|
||||
Rc::new(move |ctx| {
|
||||
f(&mut EventIdCtx {
|
||||
let mut test = EventIdCtx {
|
||||
widget,
|
||||
state: ctx.state,
|
||||
data: ctx.data,
|
||||
});
|
||||
};
|
||||
f(&mut test);
|
||||
}),
|
||||
));
|
||||
}
|
||||
@@ -128,7 +129,7 @@ impl<State: 'static, E: Event> TypeEventManager<State, E> {
|
||||
pub fn run_fn<'a>(
|
||||
&mut self,
|
||||
id: impl IdLike,
|
||||
) -> impl for<'b> FnOnce(EventCtx<State, E::Data<'b>>) + 'a {
|
||||
) -> impl for<'b> FnOnce(EventCtx<'_, State, E::Data<'b>>) + 'a {
|
||||
let fs = self.map.get(&id.id()).cloned().unwrap_or_default();
|
||||
move |ctx| {
|
||||
for (e, f) in fs {
|
||||
|
||||
Reference in New Issue
Block a user