aboutsummaryrefslogtreecommitdiff
path: root/lib/ui/interfaces.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui/interfaces.go')
-rw-r--r--lib/ui/interfaces.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/ui/interfaces.go b/lib/ui/interfaces.go
index 2f63424..9e79571 100644
--- a/lib/ui/interfaces.go
+++ b/lib/ui/interfaces.go
@@ -50,9 +50,18 @@ type Container interface {
Children() []Drawable
}
-// A drawable that can be clicked
-type Clickable interface {
+type MouseHandler interface {
+ // Handle a mouse event which occurred at the local x and y positions
+ MouseEvent(localX int, localY int, event tcell.Event)
+}
+
+// A drawable that can be interacted with by the mouse
+type Mouseable interface {
Drawable
+ MouseHandler
+}
- MouseEvent(event tcell.Event)
+type MouseableDrawableInteractive interface {
+ DrawableInteractive
+ MouseHandler
}