Skip to content

Commit

Permalink
Basic app boilerplate; display an empty window.
Browse files Browse the repository at this point in the history
  • Loading branch information
adg committed Dec 4, 2015
0 parents commit 4a9e64a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Binary file added assets/placeholder-sprites.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions main.go
@@ -0,0 +1,31 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build darwin linux

package main

import (
"golang.org/x/mobile/app"
"golang.org/x/mobile/event/lifecycle"
"golang.org/x/mobile/event/paint"
)

func main() {
app.Main(func(a app.App) {
for e := range a.Events() {
switch e := a.Filter(e).(type) {
case lifecycle.Event:
switch e.Crosses(lifecycle.StageVisible) {
case lifecycle.CrossOn:
// App visible.
case lifecycle.CrossOff:
// App no longer visible.
}
case paint.Event:
a.Publish()
}
}
})
}

0 comments on commit 4a9e64a

Please sign in to comment.