ui/pointer: expand documentation

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-08-11 13:46:27 +02:00
parent 1a9e03bf68
commit 9cc6757da9
5 changed files with 179 additions and 16 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ Drawing a colored square:
import "gioui.org/ui/paint"
var w app.Window
var ops ui.Ops
ops := new(ui.Ops)
...
ops.Reset()
paint.ColorOp{Color: ...}.Add(ops)
@@ -38,7 +38,7 @@ mutable state stack and execution flow can be controlled with macros.
The StackOp saves the current state to the state stack and restores it later:
var ops ui.Ops
ops := new(ui.Ops)
var stack ui.StackOp
// Save the current state, in particular the transform.
stack.Push(ops)
@@ -50,7 +50,7 @@ The StackOp saves the current state to the state stack and restores it later:
The MacroOp records a list of operations to be executed later:
var ops ui.Ops
ops := new(ui.Ops)
var macro ui.MacroOp
macro.Record()
// Record operations by adding them.