sunjay / turtle

Create Animated Drawings in Rust
http://turtle.rs
Mozilla Public License 2.0
561 stars 53 forks source link

Add a way to close the window #181

Open sunjay opened 4 years ago

sunjay commented 4 years ago

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

sunjay commented 3 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).