mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
op: complete the MacroOp example
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -48,10 +48,15 @@ The MacroOp records a list of operations to be executed later:
|
|||||||
|
|
||||||
ops := new(op.Ops)
|
ops := new(op.Ops)
|
||||||
var macro op.MacroOp
|
var macro op.MacroOp
|
||||||
macro.Record()
|
macro.Record(ops)
|
||||||
// Record operations by adding them.
|
// Record operations by adding them.
|
||||||
op.InvalidateOp{}.Add(ops)
|
op.InvalidateOp{}.Add(ops)
|
||||||
...
|
...
|
||||||
|
// End recording.
|
||||||
|
macro.Stop()
|
||||||
|
|
||||||
|
// replay the recorded operations by calling Add:
|
||||||
|
macro.Add(ops)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
package op
|
package op
|
||||||
|
|||||||
Reference in New Issue
Block a user