From 2dc75c2ec0d06ca28a524beb25ec3412c63f02e9 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Wed, 12 Oct 2016 09:35:03 -0700 Subject: [PATCH] Make window resizeable in BLT backend --- src/backend/blt.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/blt.rs b/src/backend/blt.rs index fa79051..4961d00 100644 --- a/src/backend/blt.rs +++ b/src/backend/blt.rs @@ -16,7 +16,8 @@ pub struct Concrete { impl backend::Backend for Concrete { fn init() -> Self { // TODO: Make this configurable? - terminal::open("Cursive", 80, 80); + terminal::open("Cursive", 80, 24); + terminal::set(terminal::config::Window::empty().resizeable(true)); Concrete { colours: BTreeMap::new() } } @@ -78,9 +79,10 @@ impl backend::Backend for Concrete { } fn poll_event(&self) -> Event { + // TODO: we could add backend-specific controls here. + // Ex: ctrl+mouse wheel cause window cellsize to change if let Some(ev) = terminal::wait_event() { match ev { - // TODO: what should we do here? BltEvent::Close => Event::Exit, BltEvent::Resize { .. } => Event::WindowResize, // TODO: mouse support