From 6b2131850817a78c57d7975bccf5fdf829dfb7e6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 27 May 2019 17:23:19 -0700 Subject: continue the move to abstracted access to all GUI elements Signed-off-by: Jeff Carr --- gui.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gui.go') diff --git a/gui.go b/gui.go index 40e42da..5c20a9a 100644 --- a/gui.go +++ b/gui.go @@ -199,6 +199,15 @@ func defaultButtonClick(button *ui.Button) { mouseClick(nil) } +func AddButton(b *ButtonMap, name string) *ui.Button { + newB := ui.NewButton(name) + newB.OnClicked(defaultButtonClick) + + b.B = newB + Data.AllButtons = append(Data.AllButtons, *b) + return newB +} + func CreateButton(a *pb.Account, vm *pb.Event_VM, name string, action string, custom func(*ButtonMap)) *ui.Button { newB := ui.NewButton(name) -- cgit v1.2.3