initial commit
This commit is contained in:
commit
0d6e4271e8
|
@ -0,0 +1,5 @@
|
|||
*
|
||||
!.gitignore
|
||||
!Makefile
|
||||
!*.go
|
||||
!go.*
|
|
@ -0,0 +1,14 @@
|
|||
all:
|
||||
go build -v -x
|
||||
./helloworld
|
||||
|
||||
push:
|
||||
git add --all
|
||||
git commit -a
|
||||
git push
|
||||
|
||||
redomod:
|
||||
rm -f go.*
|
||||
GO111MODULE= go mod init
|
||||
GO111MODULE= go mod tidy
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
// This creates a simple hello world window
|
||||
package main
|
||||
|
||||
import (
|
||||
"go.wit.com/log"
|
||||
"go.wit.com/gui/gui"
|
||||
)
|
||||
|
||||
var myGui *gui.Node // This is the beginning of the binary tree of widgets
|
||||
|
||||
// go will sit here until the window exits
|
||||
func main() {
|
||||
myGui = gui.New().Default()
|
||||
|
||||
helloworld()
|
||||
gui.Watchdog()
|
||||
}
|
||||
|
||||
// This initializes the first window, a group and a button
|
||||
func helloworld() {
|
||||
window := myGui.NewWindow("hello world")
|
||||
|
||||
group := window.NewGroup("foo bar")
|
||||
group.NewButton("hello", func() {
|
||||
log.Println("world")
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue