mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
io/pointer: update documentation examples
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+5
-5
@@ -20,7 +20,7 @@ For example, to set up a rectangular hit area:
|
|||||||
|
|
||||||
r := image.Rectangle{...}
|
r := image.Rectangle{...}
|
||||||
pointer.Rect(r).Add(ops)
|
pointer.Rect(r).Add(ops)
|
||||||
pointer.InputOp{Key: h}.Add(ops)
|
pointer.InputOp{Tag: h}.Add(ops)
|
||||||
|
|
||||||
Note that areas compound: the effective area of multiple area
|
Note that areas compound: the effective area of multiple area
|
||||||
operations is the intersection of the areas.
|
operations is the intersection of the areas.
|
||||||
@@ -37,12 +37,12 @@ For example:
|
|||||||
var stack op.StackOp
|
var stack op.StackOp
|
||||||
var h1, h2 *Handler
|
var h1, h2 *Handler
|
||||||
|
|
||||||
stack.Push(ops)
|
stack := op.Push(ops)
|
||||||
pointer.InputOp{Key: h1}.Add(Ops)
|
pointer.InputOp{Tag: h1}.Add(Ops)
|
||||||
stack.Pop()
|
stack.Pop()
|
||||||
|
|
||||||
stack.Push(ops)
|
stack = op.Push(ops)
|
||||||
pointer.InputOp{Key: h2}.Add(ops)
|
pointer.InputOp{Tag: h2}.Add(ops)
|
||||||
stack.Pop()
|
stack.Pop()
|
||||||
|
|
||||||
implies a tree of two inner nodes, each with one pointer handler.
|
implies a tree of two inner nodes, each with one pointer handler.
|
||||||
|
|||||||
Reference in New Issue
Block a user