Currently, there is no way to close the window programmatically opened by Turtle::new() or Drawing::new(). We should add a fn destroy(self) method to Drawing which allows for this.
Implementation: The destroy method can send a request to the renderer process which uses EventLoopNotifier to tell the event loop to exit. (More mentoring instructions can be provided if requested.)
To-Do
cfg_if::cfg_if! {
if #[cfg(any(feature = "test", test))] {
mod test;
pub use test::*;
// } else if #[cfg(target_os = "macos")] {
} else {
mod multiprocessed;
pub use multiprocessed::*;
//
// } else {
// mod multithreaded;
// pub use multithreaded::*;
}
}
Currently, there is no way to close the window programmatically opened by
Turtle::new()orDrawing::new(). We should add afn destroy(self)method toDrawingwhich allows for this.Implementation: The
destroymethod can send a request to the renderer process which usesEventLoopNotifierto tell the event loop to exit. (More mentoring instructions can be provided if requested.)To-Do
destroy()was the best I could come up withclose()only works whenDrawingrepresents a window, but that won't always be the casequit()might work, but it might confuse some people who expect that to end the entire processbye()is used by the Python turtle module and some LOGO implementation, but callingdrawing.bye()probably doesn't read very well...examples/runtest.rs(needs to be tested on MacOS)process::exitbecause the subprocess gets orphaned when using the multiprocessed backendbackend.rsto contain the following: