summaryrefslogtreecommitdiff
path: root/addAccount.go
blob: e9799f6b50cd182f4e58a50736f13c0cdfa2061c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package gui

import "log"

import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"

// import "github.com/davecgh/go-spew/spew"

func AddAccountWindow() {
	accounthWin := ui.NewWindow("Add Account", 400, 300, false)
	accounthWin.OnClosing(func(*ui.Window) bool {
		ui.Quit()
		return true
	})
	ui.OnShouldQuit(func() bool {
		accounthWin.Destroy()
		return true
	})

	vbox := ui.NewVerticalBox()
	vbox.SetPadded(true)
	accounthWin.SetChild(vbox)
	accounthWin.SetMargined(true)

	// This displays the window
	accounthWin.Show()

	// START create new account button
	newAccountButton := ui.NewButton("Create New Account")
		newAccountButton.OnClicked(func(*ui.Button) {
		log.Println("OK. Closing window.")
		accounthWin.Destroy()
		ui.Quit()
	})
	vbox.Append(newAccountButton, false)
	// END create new account button

	vbox.Append(ui.NewHorizontalSeparator(), false)

	okButton := ui.NewButton("I Have an Account")
	okButton.OnClicked(func(*ui.Button) {
		log.Println("OK. Closing window.")
		accounthWin.Destroy()
		ui.Quit()
	})
	vbox.Append(okButton, false)
	// END add account hbox
}

func AddAccountBox(junk *ui.Box, custom func(int, string)) *ui.Box {
	newbox := ui.NewVerticalBox()
	newbox.SetPadded(true)

	// create new account button
	newButton := CreateButton("Create New Account", "CLOSE", custom)
	newbox.Append(newButton, false)

	newbox.Append(ui.NewHorizontalSeparator(), false)

	okButton := CreateButton("I Have an Account", "CLOSE", custom)
	newbox.Append(okButton, false)

	return newbox
}