Skip to content

Examples of application that has more than one exported component #4709

Answered by tronical
norricorp asked this question in Q&A
Discussion options

You must be logged in to vote

I think the TextStyle comes from within the style. Generally there's a chance that using multiple slint! macros within the same module may produces clashes. I think it's better to use separate modules to avoid this:

mod foo {
slint::slint!{ export component A { ... } }
}
mod bar {
slint::slint! { export component B { ... } }
}

fn main() {
    foo::A::new().unwrap().show().unwrap();
    bar::B::new().unwrap().show().unwrap();
    slint::run_event_loop().unwrap();
}

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@tronical
Comment options

Answer selected by tronical
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants