summaryrefslogtreecommitdiff
path: root/gui.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-27 17:23:19 -0700
committerJeff Carr <[email protected]>2019-05-27 17:23:19 -0700
commit6b2131850817a78c57d7975bccf5fdf829dfb7e6 (patch)
tree0b7feef1e8fff3499558c261932d07ccc5181caf /gui.go
parentacefe2924215e3c70129c4017e8d58afb53372e5 (diff)
continue the move to abstracted access to all GUI elements
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gui.go')
-rw-r--r--gui.go9
1 files changed, 9 insertions, 0 deletions
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)