diff options
| author | Jeff Carr <[email protected]> | 2019-06-02 19:49:17 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-06-02 19:49:17 -0700 |
| commit | 5e505b4f7ba2f0da11695fdb9a3c483548b79a89 (patch) | |
| tree | 17198038f7ebf94f9e5cdbf4e09774804ec893f2 /button.go | |
| parent | 8967c1494c9611330782915dbf4d54f29887d135 (diff) | |
see if an interface can store the outside values
also finally fixed the splash area logic
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'button.go')
| -rw-r--r-- | button.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |
