diff options
| author | Jeff Carr <[email protected]> | 2024-01-01 15:43:50 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-01 15:43:50 -0600 |
| commit | 4e7bbd89900a733593f0848778103c1cf1a7145d (patch) | |
| tree | 22cd22124dd3ecba7c2a866b882d39aaf790d670 /examples/buttons/main.go | |
| parent | 53ce3a8252090d5fb75d7fc1e3cd75a72c1415c6 (diff) | |
reorg to final resting place at go.wit.com/gui/guiv0.9.5
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'examples/buttons/main.go')
| -rw-r--r-- | examples/buttons/main.go | 89 |
1 files changed, 0 insertions, 89 deletions
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() - }) -} |
