mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
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:
+15
-10
@@ -121,6 +121,14 @@ func main() {
|
||||
fmt.Println("The quota for anonymous GitHub API access is very low. Specify a token with -token to avoid quota errors.")
|
||||
fmt.Println("See https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line.")
|
||||
}
|
||||
err := app.CreateWindow(&app.WindowOptions{
|
||||
Width: ui.Dp(400),
|
||||
Height: ui.Dp(800),
|
||||
Title: "Gophers",
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
app.Main()
|
||||
}
|
||||
|
||||
@@ -141,16 +149,13 @@ func init() {
|
||||
fonts.italic = mustLoadFont(goitalic.TTF)
|
||||
fonts.mono = mustLoadFont(gomono.TTF)
|
||||
go func() {
|
||||
w, err := app.NewWindow(&app.WindowOptions{
|
||||
Width: ui.Dp(400),
|
||||
Height: ui.Dp(800),
|
||||
Title: "Gophers",
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := newApp(w).run(); err != nil {
|
||||
log.Fatal(err)
|
||||
for w := range app.Windows() {
|
||||
w := w
|
||||
go func() {
|
||||
if err := newApp(w).run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user