about summary refs log tree commit diff stats
path: root/lib/ui/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui/stack.go')
-rw-r--r--lib/ui/stack.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ui/stack.go b/lib/ui/stack.go
index 75cc780..690a869 100644
--- a/lib/ui/stack.go
+++ b/lib/ui/stack.go
@@ -37,6 +37,15 @@ func (stack *Stack) Draw(ctx *Context) {
 	}
 }
 
+func (stack *Stack) MouseEvent(localX int, localY int, event tcell.Event) {
+	if len(stack.children) > 0 {
+		switch element := stack.Peek().(type) {
+		case Mouseable:
+			element.MouseEvent(localX, localY, event)
+		}
+	}
+}
+
 func (stack *Stack) Push(d Drawable) {
 	if len(stack.children) != 0 {
 		stack.Peek().OnInvalidate(nil)