-
Hello guys. Is there a way to get the main window's current position coordinates? I would like to save them in a config file and start the app in the same position with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It could be something like this: fn on_exit_event(&mut self) -> bool {
MyApp::update_config_for_window_pos(something::something::something::get_current_window_pos()); // function to update config
return true
} |
Beta Was this translation helpful? Give feedback.
-
In commit 3c685d7 @TicClick added [dependencies]
egui = { git = "https://github.com/emilk/egui"}
eframe = { git = "https://github.com/emilk/egui"} After that, it is possible to: impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
let window_info = frame.info.window_info.clone();
}
} |
Beta Was this translation helpful? Give feedback.
In commit 3c685d7 @TicClick added
WindowInfo
. This provides position and size information of the native window. This info available witheframe::Frame::info().window_info
. As of writing this answer, it is not included in the latest version ofegui (0.18.1)
andeframe (0.18.0)
. In order to use this feature update theCargo.toml
as follows:After that, it is possible to: