op/paint,io/system: document ImageOp lifetime

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-14 13:15:05 +02:00
parent 391b89d11d
commit 81f474f5d7
2 changed files with 32 additions and 1 deletions
+19
View File
@@ -23,6 +23,25 @@ type FrameEvent struct {
Insets Insets
// Frame is the callback to supply the list of
// operations to complete the FrameEvent.
//
// Note that the operation list and the operations themselves
// may not be mutated until another FrameEvent is received from
// the same event source.
// That means that calls to frame.Reset and changes to referenced
// data such as ImageOp backing images should happen between
// receiving a FrameEvent and calling Frame.
//
// Example:
//
// var w *app.Window
// var frame *op.Ops
// for e := range w.Events() {
// if e, ok := e.(system.FrameEvent); ok {
// // Call frame.Reset and manipulate images for ImageOps
// // here.
// e.Frame(frame)
// }
// }
Frame func(frame *op.Ops)
// Queue supplies the events for event handlers.
Queue event.Queue