Added ui.RefreshEvent.

- Refresh signal is now propagated to controls.
This commit is contained in:
Sander Schobers 2019-03-13 21:20:31 +01:00
parent a6718e335d
commit c024416702
2 changed files with 5 additions and 1 deletions

View File

@ -67,7 +67,7 @@ func (r *Renderer) PushEvents(t ui.EventTarget, wait bool) {
case *allg5.MouseMoveEvent: case *allg5.MouseMoveEvent:
t.Handle(&ui.MouseMoveEvent{MouseEvent: mouseEvent(e.MouseEvent), MouseWheel: float32(e.DeltaZ)}) t.Handle(&ui.MouseMoveEvent{MouseEvent: mouseEvent(e.MouseEvent), MouseWheel: float32(e.DeltaZ)})
case *allg5.UserEvent: case *allg5.UserEvent:
// used to unblock the wait for events. t.Handle(&ui.RefreshEvent{EventBase: eventBase(e)})
} }
ev = r.eq.Get() ev = r.eq.Get()
} }

View File

@ -54,3 +54,7 @@ type MouseMoveEvent struct {
MouseEvent MouseEvent
MouseWheel float32 MouseWheel float32
} }
type RefreshEvent struct {
EventBase
}