summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-30 08:55:54 -0700
committerJeff Carr <[email protected]>2019-05-30 08:55:54 -0700
commit3abb0b92f481341bc80da3b971956e34d2f2ef07 (patch)
tree580c7a93d0749d3c048db810bb0f234d1b9732ac
parent5ad5afee4d9cc4b6abb527ded4ff321807af2f0f (diff)
more variable name fixes
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--addAccount.go4
-rw-r--r--area.go4
-rw-r--r--debug.go6
-rw-r--r--gui.go16
-rw-r--r--mainCloudBox.go2
-rw-r--r--structs.go14
-rw-r--r--vmBox.go4
7 files changed, 25 insertions, 25 deletions
diff --git a/addAccount.go b/addAccount.go
index 782197d..09019a7 100644
--- a/addAccount.go
+++ b/addAccount.go
@@ -36,13 +36,13 @@ func AddAccountQuestionBox(wm *GuiWindow) *ui.Box {
return vbox
}
-func generateSubdomain(b *ButtonMap) {
+func generateSubdomain(b *GuiButton) {
log.Println("generateSubdomain START")
subdomain.SetText("cust00013.wit.dev")
log.Println("generateSubdomain END")
}
-func addSubdomain(b *ButtonMap) {
+func addSubdomain(b *GuiButton) {
log.Println("generateSubdomain START")
sub := subdomain.Text()
log.Println("generateSubdomain subdomain =", sub)
diff --git a/area.go b/area.go
index 62c2514..5210163 100644
--- a/area.go
+++ b/area.go
@@ -8,8 +8,8 @@ import _ "github.com/andlabs/ui/winmanifest"
import "github.com/davecgh/go-spew/spew"
-func findFB(button *ButtonMap) *ButtonMap {
- var a *ButtonMap
+func findFB(button *GuiButton) *GuiButton {
+ var a *GuiButton
for key, foo := range Data.AllButtons {
log.Println("findFB() Data.AllButtons key, foo=", key, foo)
if &foo == button {
diff --git a/debug.go b/debug.go
index 52aacd1..a058c8a 100644
--- a/debug.go
+++ b/debug.go
@@ -80,7 +80,7 @@ func addDebuggingButtons(wm *GuiWindow, vbox *ui.Box) {
vbox.Append(CreateButton(wm, nil, nil, "Load test.json config file", "CONFIG", nil), false)
}
-func runTestHide(b *ButtonMap) {
+func runTestHide(b *GuiButton) {
/*
log.Println("runTestHide START")
Data.Window1.Box1.Hide()
@@ -91,7 +91,7 @@ func runTestHide(b *ButtonMap) {
*/
}
-func runPingClick(b *ButtonMap) {
+func runPingClick(b *GuiButton) {
log.Println("runPingClick START")
log.Println("runTestExecClick b.VM", b.VM)
hostname := "localhost"
@@ -105,7 +105,7 @@ func runPingClick(b *ButtonMap) {
log.Println("runPingClick END")
}
-func runTestExecClick(b *ButtonMap) {
+func runTestExecClick(b *GuiButton) {
log.Println("runTestExecClick START")
if runtime.GOOS == "linux" {
go runSimpleCommand("xterm -report-fonts")
diff --git a/gui.go b/gui.go
index 25910a1..163e58c 100644
--- a/gui.go
+++ b/gui.go
@@ -123,7 +123,7 @@ func ErrorWindow(wm *GuiWindow, msg1 string, msg2 string) {
// in the AllButtons %map
// TODO: clean up the text above
// TODO: remove this all together going only to main()
-func mouseClick(b *ButtonMap) {
+func mouseClick(b *GuiButton) {
log.Println("gui.mouseClick() START")
if (b == nil) {
log.Println("\tgui.mouseClick() START b = nil")
@@ -167,7 +167,7 @@ func mouseClick(b *ButtonMap) {
// This routine MUST be here as this is how the andlabs/ui works
// This is the raw routine passed to every button in andlabs libui / ui
//
-// There is a []ButtonMap which has all the buttons. We search
+// There is a []GuiButton which has all the buttons. We search
// for the button and then call the function below
//
func defaultButtonClick(button *ui.Button) {
@@ -183,7 +183,7 @@ func defaultButtonClick(button *ui.Button) {
log.Println("\tdefaultButtonClick() Data.AllButtons[key].Action =", Data.AllButtons[key].Action)
if Data.AllButtons[key].custom != nil {
log.Println("\tdefaultButtonClick() DOING CUSTOM FUNCTION")
- var tmp ButtonMap
+ var tmp GuiButton
tmp = Data.AllButtons[key]
// spew.Dump(tmp)
Data.AllButtons[key].custom(&tmp)
@@ -200,7 +200,7 @@ func defaultButtonClick(button *ui.Button) {
mouseClick(nil)
}
-func AddButton(b *ButtonMap, name string) *ui.Button {
+func AddButton(b *GuiButton, name string) *ui.Button {
newB := ui.NewButton(name)
newB.OnClicked(defaultButtonClick)
@@ -210,11 +210,11 @@ func AddButton(b *ButtonMap, name string) *ui.Button {
}
func CreateButton(wm *GuiWindow, a *pb.Account, vm *pb.Event_VM,
- name string, action string, custom func(*ButtonMap)) *ui.Button {
+ name string, action string, custom func(*GuiButton)) *ui.Button {
newUiB := ui.NewButton(name)
newUiB.OnClicked(defaultButtonClick)
- var newB ButtonMap
+ var newB GuiButton
newB.B = newUiB
newB.T = wm.T
newB.Account = a
@@ -227,11 +227,11 @@ func CreateButton(wm *GuiWindow, a *pb.Account, vm *pb.Event_VM,
return newUiB
}
-func CreateFontButton(wm *GuiWindow, action string) *ButtonMap {
+func CreateFontButton(wm *GuiWindow, action string) *GuiButton {
newB := ui.NewFontButton()
// create a 'fake' button entry for the mouse clicks
- var newBM ButtonMap
+ var newBM GuiButton
newBM.Action = action
newBM.FB = newB
newBM.AH = wm.AH
diff --git a/mainCloudBox.go b/mainCloudBox.go
index 9b42a26..4a8aab6 100644
--- a/mainCloudBox.go
+++ b/mainCloudBox.go
@@ -259,7 +259,7 @@ func InitWindow(wm *GuiWindow) {
wm.W.SetBorderless(false)
// create a 'fake' button entry for the mouse clicks
- var newBM ButtonMap
+ var newBM GuiButton
newBM.Action = "QUIT"
newBM.W = wm.W
newBM.WM = wm
diff --git a/structs.go b/structs.go
index b54f7c4..8251f24 100644
--- a/structs.go
+++ b/structs.go
@@ -22,7 +22,7 @@ type GuiData struct {
// a fallback default function to handle mouse events
// if nothing else is defined to handle them
- MouseClick func(*ButtonMap)
+ MouseClick func(*GuiButton)
// account entry textboxes
Config *pb.Config
@@ -43,7 +43,7 @@ type GuiData struct {
// A map of all buttons everywhere on all
// windows, all tabs, across all goroutines
// This is "GLOBAL"
- AllButtons []ButtonMap
+ AllButtons []GuiButton
// A map of all the entry boxes
AllEntries []*GuiEntry
@@ -71,7 +71,7 @@ type GuiEntry struct {
Account *pb.Account
VM *pb.Event_VM
- B *ButtonMap
+ B *GuiButton
FB *ui.FontButton
A *ui.Area
W *ui.Window
@@ -101,7 +101,7 @@ type FontString struct {
W font.Weight
}
-type ButtonMap struct {
+type GuiButton struct {
// andlabs/ui stuff
B *ui.Button
FB *ui.FontButton
@@ -118,13 +118,13 @@ type ButtonMap struct {
Action string // what type of button
// a callback function for the main application
- custom func (*ButtonMap)
+ custom func (*GuiButton)
}
// AREA STRUCTURES START
type AreaHandler struct{
- Button *ButtonMap
+ Button *GuiButton
Attrstr *ui.AttributedString
Area *ui.Area
WM *GuiWindow
@@ -178,7 +178,7 @@ type HumanCellData struct {
Color color.RGBA
ColorID int
VM *pb.Event_VM
- Button *ButtonMap
+ Button *GuiButton
}
type HumanMap struct {
diff --git a/vmBox.go b/vmBox.go
index 7b5fc0d..0df525b 100644
--- a/vmBox.go
+++ b/vmBox.go
@@ -53,7 +53,7 @@ func CreateVmBox(wm *GuiWindow, tab *ui.Tab, vm *pb.Event_VM) {
AddBoxToTab(vm.Name, tab, vbox)
}
-func createAddVmBox(wm *GuiWindow, tab *ui.Tab, name string, b *ButtonMap) {
+func createAddVmBox(wm *GuiWindow, tab *ui.Tab, name string, b *GuiButton) {
log.Println("createAddVmBox() START")
vbox := ui.NewVerticalBox()
vbox.SetPadded(true)
@@ -75,7 +75,7 @@ func createAddVmBox(wm *GuiWindow, tab *ui.Tab, name string, b *ButtonMap) {
hboxButtons.SetPadded(true)
vbox.Append(hboxButtons, false)
- var newb ButtonMap
+ var newb GuiButton
newb.Action = "CREATE"
newb.VM = b.VM
newb.Account = b.Account