summaryrefslogtreecommitdiff
path: root/gui.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-30 11:41:23 -0700
committerJeff Carr <[email protected]>2019-05-30 11:41:23 -0700
commitc15c731e7f7746dc5cd85cde4650a4e44a4837c7 (patch)
tree00e2d9e481ac38afba46633614d608772e657a34 /gui.go
parent570cba0b613fd9e91bee7bc3162178dddfb1a5c3 (diff)
change CreateButton to rerturn *GuiButton
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gui.go')
-rw-r--r--gui.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/gui.go b/gui.go
index 163e58c..9d3acec 100644
--- a/gui.go
+++ b/gui.go
@@ -90,8 +90,10 @@ func AddTableTab(wm *GuiWindow, mytab *ui.Tab, junk int, name string, rowcount i
hbox := ui.NewHorizontalBox()
hbox.SetPadded(true)
- hbox.Append(CreateButton(wm, account, nil, "Add Virtual Machine", "createAddVmBox", nil), false)
- hbox.Append(CreateButton(wm, account, nil, "Close", "CLOSE", nil), false)
+ a := CreateButton(wm, account, nil, "Add Virtual Machine", "createAddVmBox", nil)
+ hbox.Append(a.B, false)
+ b := CreateButton(wm, account, nil, "Add Virtual Machine", "createAddVmBox", nil)
+ hbox.Append(b.B, false)
vbox.Append(hbox, false)
@@ -210,11 +212,12 @@ func AddButton(b *GuiButton, name string) *ui.Button {
}
func CreateButton(wm *GuiWindow, a *pb.Account, vm *pb.Event_VM,
- name string, action string, custom func(*GuiButton)) *ui.Button {
+ name string, action string, custom func(*GuiButton)) *GuiButton {
newUiB := ui.NewButton(name)
newUiB.OnClicked(defaultButtonClick)
- var newB GuiButton
+ var newB *GuiButton
+ newB = new(GuiButton)
newB.B = newUiB
newB.T = wm.T
newB.Account = a
@@ -222,9 +225,9 @@ func CreateButton(wm *GuiWindow, a *pb.Account, vm *pb.Event_VM,
newB.WM = wm
newB.Action = action
newB.custom = custom
- Data.AllButtons = append(Data.AllButtons, newB)
+ Data.AllButtons = append(Data.AllButtons, *newB)
- return newUiB
+ return newB
}
func CreateFontButton(wm *GuiWindow, action string) *GuiButton {