ui/app,apps/gophers,apps/hello: replace CreateWindow with NewWindow

Gio doesn't support multiple windows anyway, so get rid of the
app.Windows channel and use NewWindow call for the mobile platforms
as well.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-03-31 13:36:24 +02:00
parent cf258f707f
commit f21b5eb1df
10 changed files with 81 additions and 93 deletions
+5 -3
View File
@@ -22,10 +22,10 @@ import (
"sync/atomic"
"time"
"gioui.org/ui"
"gioui.org/ui/f32"
"gioui.org/ui/key"
"gioui.org/ui/pointer"
"gioui.org/ui"
)
type window struct {
@@ -42,6 +42,8 @@ var layerFactory func() uintptr
var views = make(map[C.CFTypeRef]*window)
var windows = make(chan *Window)
func init() {
// Darwin requires UI operations happen on the main thread only.
runtime.LockOSThread()
@@ -233,8 +235,8 @@ func (w *window) setTextInput(s key.TextInputState) {
}
}
func createWindow(opts WindowOptions) error {
panic("unsupported")
func createWindow(opts WindowOptions) (*Window, error) {
return <-windows, nil
}
func Main() {