From 842d29373fb2910f1eefd0d1e7b8d57efb4b671b Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 11 Aug 2019 19:35:29 +0200 Subject: [PATCH] ui: documentation tweaks Signed-off-by: Elias Naur --- ui/app/app.go | 4 ++-- ui/input/input.go | 2 ++ ui/key/key.go | 6 +++--- ui/pointer/pointer.go | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/app/app.go b/ui/app/app.go index f4066c54..1613be63 100644 --- a/ui/app/app.go +++ b/ui/app/app.go @@ -13,7 +13,7 @@ import ( "gioui.org/ui" ) -// UpdateEvent is sent when a Window's Update +// An UpdateEvent is generated when a Window's Update // method must be called. type UpdateEvent struct { Config Config @@ -42,7 +42,7 @@ type Insets struct { Top, Bottom, Left, Right ui.Value } -// StageEvent is sent whenever the stage of a +// A StageEvent is generated whenever the stage of a // Window changes. type StageEvent struct { Stage Stage diff --git a/ui/input/input.go b/ui/input/input.go index 9d7185cc..552827da 100644 --- a/ui/input/input.go +++ b/ui/input/input.go @@ -33,6 +33,8 @@ package input // Queue maps an event handler key to the events // available to the handler. type Queue interface { + // Next returns the next available event, or + // false if none are available. Next(k Key) (Event, bool) } diff --git a/ui/key/key.go b/ui/key/key.go index 1ce30c28..c5aff59b 100644 --- a/ui/key/key.go +++ b/ui/key/key.go @@ -29,13 +29,13 @@ type HandlerOp struct { // be hidden. type HideInputOp struct{} -// FocusEvent is sent when a handler gains or loses +// A FocusEvent is generated when a handler gains or loses // focus. type FocusEvent struct { Focus bool } -// Event is sent when a key is pressed. For text input +// An Event is generated when a key is pressed. For text input // use EditEvent. type Event struct { // Name is the rune character that most closely @@ -47,7 +47,7 @@ type Event struct { Modifiers Modifiers } -// EditEvent is sent when text is input. +// An EditEvent is generated when text is input. type EditEvent struct { Text string } diff --git a/ui/pointer/pointer.go b/ui/pointer/pointer.go index 04645cf1..3ad2bed7 100644 --- a/ui/pointer/pointer.go +++ b/ui/pointer/pointer.go @@ -90,8 +90,8 @@ type Source uint8 type areaKind uint8 const ( - // Cancel is sent when the current gesture is interrupted - // by other handlers or the system. + // A Cancel event is generated when the current gesture is + // interrupted by other handlers or the system. Cancel Type = iota // Press of a pointer. Press