From d617938702a9f8d9cb3a6a5a04decba6b198d116 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 30 May 2019 11:56:34 -0700 Subject: change to pointers correctly Signed-off-by: Jeff Carr --- gui.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gui.go') diff --git a/gui.go b/gui.go index 9d3acec..f9b6875 100644 --- a/gui.go +++ b/gui.go @@ -185,13 +185,13 @@ 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 GuiButton + var tmp *GuiButton tmp = Data.AllButtons[key] // spew.Dump(tmp) - Data.AllButtons[key].custom(&tmp) + Data.AllButtons[key].custom(tmp) return } - mouseClick(&Data.AllButtons[key]) + mouseClick(Data.AllButtons[key]) return } } @@ -207,7 +207,7 @@ func AddButton(b *GuiButton, name string) *ui.Button { newB.OnClicked(defaultButtonClick) b.B = newB - Data.AllButtons = append(Data.AllButtons, *b) + Data.AllButtons = append(Data.AllButtons, b) return newB } @@ -225,7 +225,7 @@ 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 newB } @@ -238,10 +238,10 @@ func CreateFontButton(wm *GuiWindow, action string) *GuiButton { newBM.Action = action newBM.FB = newB newBM.AH = wm.AH - Data.AllButtons = append(Data.AllButtons, newBM) + Data.AllButtons = append(Data.AllButtons, &newBM) newB.OnChanged(func (*ui.FontButton) { - log.Println("FontButton.OnChanged() START mouseClick(&newBM)", &newBM) + log.Println("FontButton.OnChanged() START mouseClick(&newBM)", newBM) mouseClick(&newBM) }) return &newBM -- cgit v1.2.3