summaryrefslogtreecommitdiff
path: root/examples/basicwindow/basicwindow.go
blob: 8b3b4a27a3ce7fe07b37272b684e3088bb9df958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main

import (
	"github.com/andlabs/ui"
	"log"
)

func main() {

	go ui.Do(gui)

	err := ui.Go()
	if err != nil {
		log.Print(err)
	}
}

func gui() {

	// Here we create a new space
	newControl := ui.Space()

    // Then we create a window
	w := ui.NewWindow("Window", 280, 350, newControl)
	w.OnClosing(func() bool {
		ui.Stop()
		return true
	})

	w.Show()
}