From fb19290f9959530f427fa8c37657e651c3598b84 Mon Sep 17 00:00:00 2001 From: Che <43485962+c-git@users.noreply.github.com> Date: Mon, 20 Feb 2023 10:22:29 -0500 Subject: [PATCH 1/3] Update to make it more clear what will happen --- examples/serial_windows/src/main.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/serial_windows/src/main.rs b/examples/serial_windows/src/main.rs index b7dc7944a08..e456551786a 100644 --- a/examples/serial_windows/src/main.rs +++ b/examples/serial_windows/src/main.rs @@ -17,7 +17,7 @@ fn main() -> Result<(), eframe::Error> { eframe::run_native( "First Window", options.clone(), - Box::new(|_cc| Box::new(MyApp::default())), + Box::new(|_cc| Box::new(MyApp { has_next: true })), )?; std::thread::sleep(std::time::Duration::from_secs(2)); @@ -26,7 +26,7 @@ fn main() -> Result<(), eframe::Error> { eframe::run_native( "Second Window", options.clone(), - Box::new(|_cc| Box::new(MyApp::default())), + Box::new(|_cc| Box::new(MyApp { has_next: true })), )?; std::thread::sleep(std::time::Duration::from_secs(2)); @@ -35,16 +35,23 @@ fn main() -> Result<(), eframe::Error> { eframe::run_native( "Third Window", options, - Box::new(|_cc| Box::new(MyApp::default())), + Box::new(|_cc| Box::new(MyApp { has_next: false })), ) } -#[derive(Default)] -struct MyApp {} +struct MyApp { + pub(crate) has_next: bool, +} impl eframe::App for MyApp { fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { egui::CentralPanel::default().show(ctx, |ui| { + let label_text = if self.has_next { + "When this window is closed the next will be opened after a short delay" + } else { + "This is the last window. Program will end when closed" + }; + ui.label(label_text); if ui.button("Close").clicked() { eprintln!("Pressed Close button"); frame.close(); From daca1c65ed6f15bf4b47e990893ad6b5809db1d5 Mon Sep 17 00:00:00 2001 From: Che <43485962+c-git@users.noreply.github.com> Date: Mon, 20 Feb 2023 10:22:47 -0500 Subject: [PATCH 2/3] Provide an overview in readme of expectations --- examples/serial_windows/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/serial_windows/README.md b/examples/serial_windows/README.md index 278023cdba5..7543f95ca86 100644 --- a/examples/serial_windows/README.md +++ b/examples/serial_windows/README.md @@ -1,5 +1,12 @@ Demonstrates how to open several windows after each other. +Expected order of execution: + +- When the example runs a first window will be shown. +- Once the first window is closed after a delay a second window will be shown. +- Similarly, when the second window is closed after a delay a third will be shown. +- Once the third is closed the program will stop. + NOTE: this doesn't work on Mac due to . See also . From fe63bbfc6288442455e4f05aefd6e9bc729bac0b Mon Sep 17 00:00:00 2001 From: Che <43485962+c-git@users.noreply.github.com> Date: Wed, 1 Mar 2023 15:56:25 -0500 Subject: [PATCH 3/3] Update screenshot to match new code --- examples/serial_windows/screenshot.png | Bin 1680 -> 7453 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/examples/serial_windows/screenshot.png b/examples/serial_windows/screenshot.png index bf9c436073d9e6d85b5b0b64f2fdbe96e0ac5818..1f7732c091d531959d2be2055d1a2c0c730d2c51 100644 GIT binary patch literal 7453 zcmeHs`9IX(+rLt8Tk^ISi3U;jbuf&wRmfzBgoK#HAfvHHL==*QWSNqZec$(W$~4Bl z#29O`jC~ml?$h^s|9s!~AMlyS!($$=bIx3^b6w~8ysqbUyu4*{jh$71m4ShQ{l;}Y zBm=`S82Dph{s)XKx<9iAUnej+H_VyACy@C;BzQjSt$)Yc%){B+$KK0{0p;$2c9Ow3 zdO10{V;*{VuP`>k!J<>j@G-PYH8Fe28pdCBeW-Cxw@ zsL1an$ru4Ch*u@+3tI<=De6)L7-D^q=44e_DhwgC7r>6CQwF6Zx<0N& zpv9`|IVtFQeZk_nfJuJ(r#@jzr9{yLX&-@xWx-83{M=ome#HJSrrqr!s3Vysa}$+v zcF_H>+S$rtIPcZwnV+n%Y9p~3%&OdBsJ69B%F(c%%F$-L$zZ-=vx^kU_9~aK&ugy5 zeac{?xzAakSC{MM#vP)917~ z1bta+Yu^WZrLs_j`Qh^LALcukf(~-UmLEUy+(V`wbFdoD&=BA3>-p8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