diff --git a/gui-accountPage.go b/gui-accountPage.go index 50eed75..dd310d7 100644 --- a/gui-accountPage.go +++ b/gui-accountPage.go @@ -51,7 +51,7 @@ func makeCloudInfoBox(gw *gui.GuiWindow) { log.Println("makeCloudInfoBox() END") } -func initWindow(gw *gui.GuiWindow, name string) *gui.GuiWindow { +func initWindow(gw *gui.GuiWindow, name string, axis int) *gui.GuiBox { window := gui.Data.WindowMap[name] if (window != nil) { box := window.BoxMap["MAINBOX"] @@ -60,14 +60,20 @@ func initWindow(gw *gui.GuiWindow, name string) *gui.GuiWindow { return nil } // if there is not an account, then go to 'make account' - return gui.InitGuiWindow("createAccount", gw) + newWindow := gui.InitGuiWindow("createAccount", gw) + + var box *gui.GuiBox + if (axis == gui.Xaxis) { + box = gui.HardBox(newWindow, gui.Xaxis, name) + } else { + box = gui.HardBox(newWindow, gui.Yaxis, name) + } + return box } func createAccount(gw *gui.GuiWindow) { - gw = initWindow(gw, "createAccount") - if (gw == nil) { return } - - box := gui.HardBox(gw, gui.Yaxis, "Create New Account") + box := initWindow(gw, "Create New Account", gui.Yaxis) + if (box == nil) { return } // make a place for someone to enter their subdomain hardXbox := gui.HardBox(gw, gui.Xaxis, "subdomain test") diff --git a/gui-debug.go b/gui-debug.go index 852d200..8ecaed1 100644 --- a/gui-debug.go +++ b/gui-debug.go @@ -20,16 +20,15 @@ func debugClick(b *gui.GuiButton) { // if there is not an account, then go to 'make account' // gw = gui.InitGuiWindow("debugClick", gw) - gw = initWindow(gw, "Debugging") - - log.Println("debugClick() AddGenericBox() START") - box := gui.HardBox(gw, gui.Yaxis, "debugging") - log.Println("debugClick() AddGenericBox() END box =", box) + box := initWindow(gw, "Debugging", gui.Yaxis) + if (box == nil) { return } + log.Println("debugClick() initWindow() END") makeButton(box, nil, nil, "empty", "SUBDOMAIN", nil) gui.HorizontalBreak(box) makeButton(box, nil, nil, "Create Subdomain Account", "ADD", addSubdomainClick) - hardXbox := gui.HardBox(gw, gui.Xaxis, "subdomain test") + + hardXbox := gui.HardBox(box.Window, gui.Xaxis, "subdomain test") Ybox1 := gui.NewBox(hardXbox, gui.Yaxis, "subdomain Y test") Xbox1 := gui.NewBox(Ybox1, gui.Xaxis, "subdomain Y test") makeButton(Xbox1, nil, nil, "ping", "SUBDOMAIN", runPingClick)