From 96120e602f43e225d22af6ec1053ebc6797a79f7 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 24 Mar 2021 18:24:39 +0530 Subject: new quit primitive --- src/app.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index 008b273..d35febf 100644 --- a/src/app.rs +++ b/src/app.rs @@ -470,6 +470,11 @@ impl<'ctx> AppState<'ctx> { self.draw(); self.canvas.present(); } + + pub fn quit(&mut self) { + let ev = self.context.event().unwrap(); + ev.push_event(Event::Quit { timestamp: 0u32 }); + } } // publicly available functions on appstate @@ -606,8 +611,6 @@ impl<'ctx> AppState<'ctx> { } } Keycode::V => self.cycle_symmetry(), - // exit - Keycode::Escape => break 'running, // undo & redo Keycode::U => { if let Some(op) = self.undo_stack.undo() { -- cgit v1.2.3