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
I'm running code which in simplified version looks like this
use std::{thread, time};use druid::widget::{Button,Flex};use druid::{AppLauncher,Widget,WindowDesc};// Clicking a button should close the window//// The close button close the window//fn main () {// let window = WindowDesc::new(build_widget);// AppLauncher::with_window(window)// .use_simple_logger()// .launch(0_u32)// .expect("launch failed");//// dbg!("GUI killed");//}// The close button makes the window hangfnmain(){dbg!("LAUNCH_GUI");letmut should_gui = true;loop{dbg!("LOOP ITERATION");if should_gui == true{dbg!("SHOW GUI");
should_gui = false;let window = WindowDesc::new(build_widget);AppLauncher::with_window(window).use_simple_logger().launch(0_u32).expect("launch failed");dbg!("GUI KILLED");}let sleep_time = time::Duration::from_millis(100);
thread::sleep(sleep_time);}}fnbuild_widget() -> implWidget<u32>{Flex::column().with_child(Button::sized("Close",
|evt_ctx ,data:_, _env| {dbg!(&data);//evt_ctx.window().close();
evt_ctx.submit_command(druid::commands::CLOSE_WINDOW,None);},80.0,20.0,),0.0,)}
I'm expecting the window is closed properly and the program keeps looping without GUI.
Instead, I'm getting a hanging window which can't be closed, see
I'm running code which in simplified version looks like this
I'm expecting the window is closed properly and the program keeps looping without GUI.
Instead, I'm getting a hanging window which can't be closed, see
Also discussed here: https://xi.zulipchat.com/#narrow/stream/147926-druid/topic/evt_ctx.2Ewindow().2Eclose().20not.20working.3F
Software versions
gtk3-devel.x86_64 3.24.13-1.fc31
glib2-devel.x86_64 2.62.3-1.fc31
The text was updated successfully, but these errors were encountered: