ui/app,apps/gophers,apps/hello: revert NewWindow to CreateWindow

It turns out we already support multiple windows on Android: when
the activity is recreated.

This reverts commit f21b5eb1df.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-04-02 19:26:23 +02:00
parent 6899f96532
commit ed2590e30e
9 changed files with 90 additions and 80 deletions
+9 -4
View File
@@ -59,12 +59,13 @@ const (
// Set it with the go tool linker flag -X.
var extraArgs string
// NewWindow creates a new window for a set of window
var windows = make(chan *Window)
// CreateWindow creates a new window for a set of window
// options. The options are hints; the platform is free to
// ignore or adjust them.
// If the current program is running on iOS and Android,
// NewWindow the window previously created by the platform.
func NewWindow(opts *WindowOptions) (*Window, error) {
// CreateWindow is not supported on iOS and Android.
func CreateWindow(opts *WindowOptions) error {
if opts == nil {
opts = &WindowOptions{
Width: ui.Dp(800),
@@ -78,6 +79,10 @@ func NewWindow(opts *WindowOptions) (*Window, error) {
return createWindow(opts)
}
func Windows() <-chan *Window {
return windows
}
func (l Stage) String() string {
switch l {
case StageDead: