app: rename UpdateEvent to FrameEvent and add Frame field

While "DrawEvent" was too specific (op.Ops contains non-draw events),
"Update" is too vague: it's a common word, and could be misunderstood
to mean update parts of a window, not replace it.

"FrameEvent" is more specific, and is the usual way to refer to immediate
mode drawing.

While we're here, unexport Window.Update and add a Frame function to
FrameEvent, to emphasize that updating the window frame is only
appropriate during the handling of a FrameEvent.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-10 12:15:04 +02:00
parent e49df512f6
commit a937a76534
9 changed files with 29 additions and 25 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ func onDraw(view C.CFTypeRef, dpi, sdpi, width, height C.CGFloat, sync C.int, to
if sync != 0 {
isSync = true
}
w.w.event(UpdateEvent{
w.w.event(FrameEvent{
Size: image.Point{
X: int(width + .5),
Y: int(height + .5),