summaryrefslogtreecommitdiff
path: root/button.go
diff options
context:
space:
mode:
Diffstat (limited to 'button.go')
-rw-r--r--button.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/button.go b/button.go
index 087d768..0e23991 100644
--- a/button.go
+++ b/button.go
@@ -73,6 +73,27 @@ func CreateButton(box *GuiBox, a *pb.Account, vm *pb.Event_VM, name string, acti
return newB
}
+func NewCreateButton(box *GuiBox, custom func(*GuiButton), name string, values interface {}) *GuiButton {
+ newUiB := ui.NewButton(name)
+ newUiB.OnClicked(defaultButtonClick)
+
+ var newB *GuiButton
+ newB = new(GuiButton)
+ newB.B = newUiB
+ if (box.Window == nil) {
+ log.Println("CreateButton() box.Window == nil")
+ panic("crap")
+ }
+ newB.Box = box
+ newB.Custom = custom
+ newB.Values = values
+
+ Data.AllButtons = append(Data.AllButtons, newB)
+
+ box.UiBox.Append(newB.B, false)
+ return newB
+}
+
func CreateFontButton(box *GuiBox, action string) *GuiButton {
// create a 'fake' button entry for the mouse clicks
var newGB GuiButton