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
+6 -7
View File
@@ -59,19 +59,18 @@ const (
// Set it with the go tool linker flag -X.
var extraArgs string
var windows = make(chan *Window)
func CreateWindow(opts WindowOptions) error {
// NewWindow 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) {
if opts.Width.V <= 0 || opts.Height.V <= 0 {
panic("window width and height must be larger than 0")
}
return createWindow(opts)
}
func Windows() <-chan *Window {
return windows
}
func (l Stage) String() string {
switch l {
case StageDead: