diff options
Diffstat (limited to 'examples/buttons')
| -rw-r--r-- | examples/buttons/Makefile | 29 | ||||
| -rw-r--r-- | examples/buttons/main.go | 89 |
2 files changed, 0 insertions, 118 deletions
diff --git a/examples/buttons/Makefile b/examples/buttons/Makefile deleted file mode 100644 index 7de8165..0000000 --- a/examples/buttons/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# with andlabs plugin loaded: -# PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND -# 180006 jcarr 20 0 1918460 41688 31152 S 0.7 0.3 0:00.27 buttonplugin - -# with gocui plugin loaded: -# 180365 jcarr 20 0 1392668 24364 12596 S 2.0 0.2 0:00.09 buttonplugin -# - -run: build - ./buttons - -debug: - ./buttons --gui andlabs --gui-debug --log-debug - -build-release: - go get -v -u -x . - go build - ./buttons - -build: - GO111MODULE="off" go get -v -x . - GO111MODULE="off" go build - -update: - GO111MODULE="off" go get -v -u -x . - -log: - reset - tail -f /tmp/witgui.* /tmp/guilogfile diff --git a/examples/buttons/main.go b/examples/buttons/main.go deleted file mode 100644 index 87841a7..0000000 --- a/examples/buttons/main.go +++ /dev/null @@ -1,89 +0,0 @@ -// This is a simple example -package main - -import ( - "log" - "strconv" - "go.wit.com/gui" - arg "github.com/alexflint/go-arg" -) - -var title string = "Demo Plugin Window" -var myGui *gui.Node - -var buttonCounter int = 5 -var gridW int = 5 -var gridH int = 3 - -func init() { - arg.MustParse() -} - -func main() { - // This will turn on all debugging - // gui.SetDebug(true) - - myGui = gui.New().Default() - buttonWindow() - - // This is just a optional goroutine to watch that things are alive - gui.Watchdog() - gui.StandardExit() -} - -// This creates a window -func buttonWindow() { - var w, t, g, more, more2 *gui.Node - - log.Println("buttonWindow() START") - - w = myGui.NewWindow(title).SetText("Nueva Ventana de Botones") - t = w.NewTab("buttonTab is this thing").Pad() - g = t.NewGroup("buttonGroup").Pad() - g1 := t.NewGroup("buttonGroup 2").Pad() - more = g1.NewGroup("more").Pad() - g1.NewButton("hello2", func () { - log.Println("world2") - }) - more2 = g1.NewGrid("gridnuts", gridW, gridH).Pad() - - more2.NewLabel("more2") - - g.NewButton("hello", func () { - log.Println("world") - }) - - g.NewButton("NewButton(more)", func () { - name := "foobar " + strconv.Itoa(buttonCounter) - log.Println("NewButton(more) Adding button", name) - buttonCounter += 1 - more.NewButton(name, func () { - log.Println("Got all the way to main() name =", name) - }) - }) - - g.NewButton("NewButton(more2)", func () { - name := "foobar " + strconv.Itoa(buttonCounter) - log.Println("NewButton(more2) Adding button", name) - buttonCounter += 1 - more2.NewButton(name, func () { - log.Println("Got all the way to main() name =", name) - }) - }) - - g.NewButton("NewButton(more2 d)", func () { - name := "d" + strconv.Itoa(buttonCounter) - log.Println("NewButton(more2 d) Adding button", name) - buttonCounter += 1 - more2.NewButton(name, func () { - log.Println("Got all the way to main() name =", name) - }) - }) - - g.NewButton("NewGroup()", func () { - name := "neat " + strconv.Itoa(buttonCounter) - log.Println("NewGroup() Adding button", name) - buttonCounter += 1 - more.NewGroup(name).Pad() - }) -} |
