Replies: 1 comment
-
You have to put svg_path in a let svg_path = Rc::new(RefCell::new(...))
let svg_path2 = svg_path.clone();
handler.on_mouse_moved({
move |x: f32, y: f32| {
info!("{}, {}", x, y);
let point = [x as usize, y as usize]; // <- i want to store the data in rust
svg_path2.borrow_mut().add_point(point); // <- i want to use the data in another rust function, but cannot due the the closure
}
}); I hope this helps |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking for a solution to access my slint data in rust. The problem is all slint data is accessed via closures. How to I break my data out of the closure prison?
For example I have the following rust callback:
Beta Was this translation helpful? Give feedback.
All reactions