diff --git a/main.go b/main.go index ad9a8bb..736a7ef 100644 --- a/main.go +++ b/main.go @@ -37,36 +37,26 @@ func cloudApp(n *gui.Node) *gui.Node { win := n.NewWindow(title) // make a group label and a grid - group := win.NewGroup("data").Pad() - grid := group.NewGrid("grid", 2, 1).Pad() + // group := win.NewGroup("data").Pad() + box := win.Box() + grid := box.NewGrid("grid", 2, 1).Pad() - grid.NewButton("New()", func () { - myDo = digitalocean.New(myGui) + grid.NewButton("Show Droplets", func () { + if myDo == nil { + myDo = digitalocean.New(myGui) + } else { + myDo.Toggle() + } }) grid.NewLabel("initializes the DO golang gui package") - grid.NewButton("Show", func () { - myDo.Show() - }) - grid.NewLabel("will show the DO window") - - grid.NewButton("Hide", func () { - myDo.Hide() - }) - grid.NewLabel("will hide the DO window") - - grid.NewButton("Update", func () { - myDo.Update() - }) - grid.NewLabel("polls DO via the API to find the state of all your droplets") - grid.NewButton("Create", func () { // myDo.Create("jcarr.wit.com") digitalocean.InitCreateWindow() }) grid.NewLabel("makes a new droplet") - grid.NewButton("gui debugger", func () { + box.NewButton("gui debugger", func () { debugger.DebugWindow() }) grid.NewLabel("make sure you have $ENV(DIGITALOCEAN_TOKEN} set to your API token")