aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui/stack.go')
-rw-r--r--lib/ui/stack.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ui/stack.go b/lib/ui/stack.go
index 3c66f5a6..2b97e78a 100644
--- a/lib/ui/stack.go
+++ b/lib/ui/stack.go
@@ -8,7 +8,7 @@ import (
type Stack struct {
children []Drawable
- onInvalidate func(d Drawable)
+ onInvalidate []func(d Drawable)
}
func NewStack() *Stack {
@@ -16,12 +16,12 @@ func NewStack() *Stack {
}
func (stack *Stack) OnInvalidate(onInvalidate func (d Drawable)) {
- stack.onInvalidate = onInvalidate
+ stack.onInvalidate = append(stack.onInvalidate, onInvalidate)
}
func (stack *Stack) Invalidate() {
- if stack.onInvalidate != nil {
- stack.onInvalidate(stack)
+ for _, fn := range stack.onInvalidate {
+ fn(stack)
}
}