start tracking which tabs exist

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-03 15:45:25 -07:00
parent 7c420444d0
commit a2e5eb023a
3 changed files with 17 additions and 3 deletions

View File

@ -42,15 +42,26 @@ func makeCloudInfoBox(gw *gui.GuiWindow) {
}
Xbox := gui.HardBox(gw, gui.Xaxis, "subdomain test")
makeButton(Xbox, nil, nil, "Add Account", "ADD TAB", addSubdomainClick)
makeButton(Xbox, nil, nil, "Add Account", "ADD TAB", func (*gui.GuiButton) {
log.Println("makeCloudInfoBox() Add Account")
createAccount(gw)
})
makeButton(Xbox, nil, nil, "Quit", "QUIT", nil)
makeButton(Xbox, nil, nil, "Debug", "DEBUG", debugClick)
log.Println("makeCloudInfoBox() END")
}
func createAccount(gw *gui.GuiWindow) {
window := gui.Data.WindowMap["createAccount"]
if (window != nil) {
box := window.BoxMap["MAINBOX"]
log.Println("createAccount tab already exists")
gui.MessageWindow(box.Window, "createAccount", "New account tab already exists")
return
}
// if there is not an account, then go to 'make account'
gw = gui.InitGuiWindow("splashClick() Box22", gw)
gw = gui.InitGuiWindow("createAccount", gw)
box := gui.HardBox(gw, gui.Yaxis, "Create New Account")

View File

@ -22,7 +22,7 @@ func debugClick(b *gui.GuiButton) {
gw := b.Box.Window
// if there is not an account, then go to 'make account'
gw = gui.InitGuiWindow("debug() Box22", gw)
gw = gui.InitGuiWindow("debugClick", gw)
log.Println("debugClick() AddGenericBox() START")
box := gui.HardBox(gw, gui.Yaxis, "debugging")

View File

@ -55,6 +55,9 @@ type myButtonInfo struct {
// cross platform openvpn that may work for IPv6
// https://github.com/mysteriumnetwork/go-openvpnwe
// i18n with 'po' file support
// https://github.com/leonelquinteros/gotext
func onExit(err error) {
log.Println("Sleep for 1 second")
time.Sleep(1 * 1000 * 1000 * 1000)