Global export not available in main.rs #3511
-
I am following the docs here to create a global callback function :
I have a slint file with the following declaration: export global Utils {
pure callback color-to-hex(color) -> string;
} My slint::include_modules!();
fn main() {
let app = App::new().unwrap();
app.global::<Utils>().on_color_to_hex(|color| {
"#ff00ff"
});
app.run().unwrap();
} I was able to reference the
I was expecting that the Is there some step I am missing to make |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
you should do re-import and |
Beta Was this translation helpful? Give feedback.
you should do re-import and
export { Utils }
from the main slint file (or slint! macro)