Open sunjay opened 4 years ago
Re-opening until this method is stabilized. We need to decide on the name (destroy
is fine for now but maybe there is a better option?), and we need to expand on the docs and test the panic that occurs when you use a turtle after its drawing has been destroyed (make sure the panic message is helpful).
Currently, there is no way to close the window programmatically opened by
Turtle::new()
orDrawing::new()
. We should add afn destroy(self)
method toDrawing
which allows for this.Implementation: The
destroy
method can send a request to the renderer process which usesEventLoopNotifier
to 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 whenDrawing
represents 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...[x] Resolve TODO comment in
examples/runtest.rs
(needs to be tested on MacOS)process::exit
because the subprocess gets orphaned when using the multiprocessed backendbackend.rs
to contain the following:// } else if #[cfg(target_os = "macos")] { } else { mod multiprocessed; pub use multiprocessed::; // // } else { // mod multithreaded; // pub use multithreaded::; } }