From c0244167027d91a95ddefc01b483b1855e8ffc2c Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Wed, 13 Mar 2019 21:20:31 +0100 Subject: [PATCH] Added ui.RefreshEvent. - Refresh signal is now propagated to controls. --- ui/allg5ui/renderer.go | 2 +- ui/event.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/allg5ui/renderer.go b/ui/allg5ui/renderer.go index 292b72e..5aff846 100644 --- a/ui/allg5ui/renderer.go +++ b/ui/allg5ui/renderer.go @@ -67,7 +67,7 @@ func (r *Renderer) PushEvents(t ui.EventTarget, wait bool) { case *allg5.MouseMoveEvent: t.Handle(&ui.MouseMoveEvent{MouseEvent: mouseEvent(e.MouseEvent), MouseWheel: float32(e.DeltaZ)}) case *allg5.UserEvent: - // used to unblock the wait for events. + t.Handle(&ui.RefreshEvent{EventBase: eventBase(e)}) } ev = r.eq.Get() } diff --git a/ui/event.go b/ui/event.go index e31c2fe..f633d91 100644 --- a/ui/event.go +++ b/ui/event.go @@ -54,3 +54,7 @@ type MouseMoveEvent struct { MouseEvent MouseWheel float32 } + +type RefreshEvent struct { + EventBase +}