You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My hardware is compatible and my graphics drivers are up-to-date.
What happened?
I have multiple windows that i need to build and in order to keep the main function neat and clean i wanted to split the build process of these windows into their own files/build functions.
// main.rslet app = app::App::default().with_scheme(app::Scheme::Gleam);// ...// build new entry window
new_entry_window::build_ui();// build loading window
loading_window::build_ui();// build info window
info_window::build_ui();// build main window
main_window::build_ui();
app.run().unwrap();
// loading_window.rs// example builder of one of the windowspubfnbuild_ui(){// app statelet state = app::GlobalState::<AppState>::get();let cfg = state.with(|s| s.cfg.clone());// screen working arealet(x, y, w, h) = app::screen_work_area(cfg.screen_num);// loading windowletmut loading_window = window::Window::default().with_size(400,90).center_screen();
loading_window.set_label("Lade PDF...");
loading_window.make_modal(true);
loading_window.set_pos(x + (w / 2 - 400 / 2), y + (h / 2 - 90 / 2));
loading_window.set_cursor(enums::Cursor::Wait);letmut loading =
image::PngImage::load(std::path::Path::new("assets/hourglass1.png")).unwrap();
loading.scale(60,60,true,true);letmut loading_frame = frame::Frame::default().center_of_parent();
loading_frame.set_image(Some(loading));
loading_window.end();// add window to app state
state.with(move |s| s.wnd_load = loading_window.clone());}
I am using the global state to be able to get a referance to one of the windows. When i .show() on any window, it only shows the last one. In this case the main window and not my "info" window which should open ontop of the main window. The main window gets displayed tho. Both have the .show() method beeing called on them.
I have also tried to use the global state in the main rust file to show both windows but it has exactly the same result.
I also noticed that the window i want to show too is flickering at startup so it gets created but closes immediatly and only the last one beeing called is visable.
My guess is it has something to do with scoping of the build functions. In that case, what is the best way to split out the build process of larger projects without that happening?
What is the expected behavior?
The main window and the info window should both be visible at the same time.
Version
master
Operative System
Windows
Do you have any log output?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Is this issue related to iced?
What happened?
I have multiple windows that i need to build and in order to keep the main function neat and clean i wanted to split the build process of these windows into their own files/build functions.
I am using the global state to be able to get a referance to one of the windows. When i .show() on any window, it only shows the last one. In this case the main window and not my "info" window which should open ontop of the main window. The main window gets displayed tho. Both have the .show() method beeing called on them.
I have also tried to use the global state in the main rust file to show both windows but it has exactly the same result.
I also noticed that the window i want to show too is flickering at startup so it gets created but closes immediatly and only the last one beeing called is visable.
My guess is it has something to do with scoping of the build functions. In that case, what is the best way to split out the build process of larger projects without that happening?
What is the expected behavior?
The main window and the info window should both be visible at the same time.
Version
master
Operative System
Windows
Do you have any log output?
No response
The text was updated successfully, but these errors were encountered: