summaryrefslogtreecommitdiffstats
path: root/src/hbox.rs
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-01-21 15:53:16 +0100
committerrabite <rabite@posteo.de>2019-01-21 15:53:16 +0100
commitb29a3189287a4a603bcfb74ff7db52410f345d3d (patch)
tree233f1b67287726084e43bb38afd2361f66348721 /src/hbox.rs
parent67c973c0af1d35f0f832d4eb594c12868ef78008 (diff)
fixed key handling
Diffstat (limited to 'src/hbox.rs')
-rw-r--r--src/hbox.rs19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/hbox.rs b/src/hbox.rs
index 3be950a..7013b2b 100644
--- a/src/hbox.rs
+++ b/src/hbox.rs
@@ -1,5 +1,14 @@
+use termion::event::{Event};
+
use crate::widget::Widget;
+// pub struct Child<T> {
+// widget: T,
+// position: (u16, u16),
+// size: (u16, u16),
+// active: bool
+// }
+
pub struct HBox {
dimensions: (u16, u16),
position: (u16, u16),
@@ -20,9 +29,7 @@ impl HBox {
impl Widget for HBox {
fn render(&self) -> Vec<String> {
- // self.children.iter().map(|child| {
- // child.render()
- // }).collect()
+ // HBox doesnt' draw anything itself
vec![]
}
@@ -47,5 +54,9 @@ impl Widget for HBox {
}
fn get_position(&self) -> (u16, u16) {
self.position
- }
+ }
+
+ fn on_event(&mut self, event: Event) {
+ self.children[self.main].on_event(event);
+ }
}