io/pointer: added CursorNameOp

The cursor can now be customized for a given area.

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2020-12-08 18:54:50 +01:00
committed by Elias Naur
parent 675e86b8e8
commit 7c5bcd3db8
6 changed files with 57 additions and 3 deletions
+6 -1
View File
@@ -48,7 +48,8 @@ type Window struct {
nextFrame time.Time
delayedDraw *time.Timer
queue queue
queue queue
cursor pointer.CursorName
callbacks callbacks
}
@@ -414,6 +415,10 @@ func (w *Window) run(opts *window.Options) {
w.setNextFrame(time.Time{})
w.updateAnimation()
}
if c := w.queue.q.Cursor(); c != w.cursor {
w.cursor = c
w.SetCursorName(c)
}
w.out <- e
}
w.ack <- struct{}{}