generate subdomain

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-30 01:58:05 -07:00
parent cb8b97650e
commit 49e3887aa6
4 changed files with 27 additions and 9 deletions

View File

@ -10,24 +10,27 @@ var subdomain *ui.Entry
func AddAccountQuestionBox(wm *WindowMap) *ui.Box {
vbox := ui.NewVerticalBox()
vbox.SetPadded(true)
wm.Box1 = vbox
vboxN := ui.NewVerticalBox()
vboxN.SetPadded(true)
vboxN.Append(ui.NewLabel("Enter your Subdomain:"), false)
hbox := ui.NewHorizontalBox()
hbox.SetPadded(true)
vbox.Append(hbox, false)
hbox.Append(ui.NewLabel("Enter your Subdomain or"), false)
generate := CreateButton(wm, nil, nil, "Make me a Subdomain", "SUBDOMAIN", generateSubdomain)
hbox.Append(generate, false)
subdomain = ui.NewEntry()
subdomain.SetReadOnly(false)
vboxN.Append(subdomain, false)
subdomain.OnChanged(func(*ui.Entry) {
log.Println("OK. subdomain =", subdomain.Text())
})
vbox.Append(vboxN, false)
vbox.Append(subdomain, false)
vbox.Append(ui.NewHorizontalSeparator(), false)
okButton := CreateButton(wm, nil, nil, "Make me a Subdomain", "SUBDOMAIN", generateSubdomain)
okButton := CreateButton(wm, nil, nil, "Create Subdomain Account", "SUBDOMAIN", addSubdomain)
vbox.Append(okButton, false)
return vbox
@ -39,6 +42,13 @@ func generateSubdomain(b *ButtonMap) {
log.Println("generateSubdomain END")
}
func addSubdomain(b *ButtonMap) {
log.Println("generateSubdomain START")
sub := subdomain.Text()
log.Println("generateSubdomain subdomain =", sub)
log.Println("generateSubdomain END")
}
func AddAccountBox(wm *WindowMap) *ui.Box {
vbox := ui.NewVerticalBox()
vbox.SetPadded(true)

View File

@ -28,6 +28,7 @@ func makeSplashArea(wm *WindowMap, ah *AreaHandler) {
// ah.Attrstr = makeAttributedString()
ah.Area = ui.NewArea(ah)
newB.A = ah.Area
newB.WM = wm
// Data.AllButtons[1].A = ah.Area
// ah.Button = &Data.AllButtons[1]
ah.Button = newB

3
gui.go
View File

@ -175,6 +175,7 @@ func defaultButtonClick(button *ui.Button) {
for key, foo := range Data.AllButtons {
if (Data.Debug) {
log.Println("defaultButtonClick() Data.AllButtons =", key, foo)
spew.Dump(foo)
}
if Data.AllButtons[key].B == button {
log.Println("\tdefaultButtonClick() BUTTON MATCHED")
@ -184,7 +185,7 @@ func defaultButtonClick(button *ui.Button) {
log.Println("\tdefaultButtonClick() DOING CUSTOM FUNCTION")
var tmp ButtonMap
tmp = Data.AllButtons[key]
spew.Dump(tmp)
// spew.Dump(tmp)
Data.AllButtons[key].custom(&tmp)
return
}

View File

@ -3,6 +3,7 @@ package gui
import "log"
import "time"
import "regexp"
import "os"
// import "reflect"
import "github.com/andlabs/ui"
@ -161,6 +162,11 @@ func AddVmsTab(wm *WindowMap, name string, count int, a *pb.Account) *TableData
}
func ShowAccountQuestionTab(wm *WindowMap) {
log.Println("ShowAccountQuestionTab() wm =", wm)
if (wm.T == nil) {
log.Println("ShowAccountQuestionTab() wm.T = nil THIS IS BAD")
os.Exit(-1)
}
wm.T.Delete(0)
log.Println("Sleep(200)")