How to get a handle to the window created by dioxus::desktop::launch(app); #635
-
I would like to set the initial size of a window, which I see can be done with tao::window::Window.set_inner_size(). and access all the Window methods. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I'm not sure if this is the preferred way to do things, but it's how we did it, hopefully it helps: https://github.com/Satellite-im/Uplink/blob/dev/src/main.rs#L181-L209 use tao::window::WindowBuilder;
...
let window = WindowBuilder::new()
.with_title(DEFAULT_WINDOW_NAME.read().clone())
.with_resizable(true)
.with_inner_size(LogicalSize::new(950.0, 600.0))
.with_min_inner_size(LogicalSize::new(330.0, 500.0));
dioxus::desktop::launch_with_props(
App,
None,
|c| c.with_window(|_| window),
);
} The menu stuff is something some systems (like MacOS) require in order to enable keybinds like copy paste and select all. |
Beta Was this translation helpful? Give feedback.
I'm not sure if this is the preferred way to do things, but it's how we did it, hopefully it helps: https://github.com/Satellite-im/Uplink/blob/dev/src/main.rs#L181-L209
The menu stuff is something some systems (like MacOS) require in order to enable keybinds like copy paste and select all.