Skip to content
Discussion options

You must be logged in to vote

Right now, it is possible with private API using the i-slint-backend-winit crate.
You need to enable it like so in your Cargo.toml file

i-slint-backend-winit = "=1.1.0"

with the "=" , because we don't follow semver for internal crates.
then you can do something like

fn main() {
    // make sure the winit platform is initialized (as opposed to an other platform) by setting it before any other slint call
    slint::platform::set_platform(Box::new(i_slint_backend_winit::Backend::new()));
    
    // ...

    i_slint_backend_winit::WinitWindowAccessor::with_winit_window(ui1.window(), |win| win.focus_window());
}

(I haven't tried this)
But this use the winit::Window API and allow to have more …

Replies: 8 comments 7 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
@Vadoola
Comment options

Answer selected by pcevent
Comment options

You must be logged in to vote
0 replies
Comment options

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

Comment options

You must be logged in to vote
3 replies
@pcevent
Comment options

@ogoffart
Comment options

@pcevent
Comment options

Comment options

You must be logged in to vote
2 replies
@ogoffart
Comment options

@Vadoola
Comment options

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