app: add support for system cursors

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2020-12-02 16:50:56 +01:00
committed by Elias Naur
parent 951d45a2c6
commit 69cc2c795c
15 changed files with 297 additions and 18 deletions
+8
View File
@@ -10,6 +10,7 @@ import (
"gioui.org/app/internal/window"
"gioui.org/io/event"
"gioui.org/io/pointer"
"gioui.org/io/profile"
"gioui.org/io/router"
"gioui.org/io/system"
@@ -209,6 +210,13 @@ func (w *Window) WriteClipboard(s string) {
})
}
// SetCursorName changes the current window cursor to name.
func (w *Window) SetCursorName(name pointer.CursorName) {
go w.driverDo(func() {
w.driver.SetCursor(name)
})
}
// Close the window. The window's event loop should exit when it receives
// system.DestroyEvent.
//