summaryrefslogtreecommitdiff
path: root/gui.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-06-02 15:19:53 -0700
committerJeff Carr <[email protected]>2019-06-02 15:19:53 -0700
commitd6cc47ab94bf294b69116f9479b49f0302bfc7b5 (patch)
treed6652d07ea5c1a9a004caa110848d1a509aad54f /gui.go
parent16008fefad4573af5e0c5bc9909f0e5114863ec6 (diff)
almost complete 'CLEAN'. yet more code refactoring
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gui.go')
-rw-r--r--gui.go48
1 files changed, 2 insertions, 46 deletions
diff --git a/gui.go b/gui.go
index b412e20..eccc6e8 100644
--- a/gui.go
+++ b/gui.go
@@ -12,8 +12,6 @@ import pb "git.wit.com/wit/witProtobuf"
// import "github.com/davecgh/go-spew/spew"
-// THIS IS NOT CLEAN (except the Memory normalization example)
-
const Xaxis = 0
const Yaxis = 1
@@ -73,10 +71,12 @@ func InitTabWindow(gw *GuiWindow) {
gw.UiWindow.SetBorderless(false)
// create a 'fake' button entry for the mouse clicks
+ /*
var newBM GuiButton
newBM.Action = "QUIT"
newBM.GW = gw
Data.AllButtons = append(Data.AllButtons, &newBM)
+ */
gw.UiWindow.OnClosing(func(*ui.Window) bool {
log.Println("InitTabWindow() OnClosing() THIS WINDOW IS CLOSING gw=", gw)
@@ -128,50 +128,6 @@ func normalizeInt(s string) string {
return clean
}
-/*
-func defaultEntryChange(e *ui.Entry) {
- for key, em := range Data.AllEntries {
- if (Data.Debug) {
- log.Println("\tdefaultEntryChange() Data.AllEntries =", key, em)
- }
- if Data.AllEntries[key].UiEntry == e {
- log.Println("defaultEntryChange() FOUND",
- "action =", Data.AllEntries[key].Action,
- "Last =", Data.AllEntries[key].Last,
- "e.Text() =", e.Text())
- Data.AllEntries[key].Last = e.Text()
- if Data.AllEntries[key].Normalize != nil {
- fixed := Data.AllEntries[key].Normalize(e.Text())
- e.SetText(fixed)
- }
- return
- }
- }
- log.Println("defaultEntryChange() ERROR. MISSING ENTRY MAP. e.Text() =", e.Text())
-}
-
-func defaultMakeEntry(startValue string, edit bool, action string) *GuiEntry {
- e := ui.NewEntry()
- e.SetText(startValue)
- if (edit == false) {
- e.SetReadOnly(true)
- }
- e.OnChanged(defaultEntryChange)
-
- // add the entry field to the global map
- var newEntry GuiEntry
- newEntry.UiEntry = e
- newEntry.Edit = edit
- newEntry.Action = action
- if (action == "Memory") {
- newEntry.Normalize = normalizeInt
- }
- Data.AllEntries = append(Data.AllEntries, &newEntry)
-
- return &newEntry
-}
-*/
-
func MessageWindow(gw *GuiWindow, msg1 string, msg2 string) {
ui.MsgBox(gw.UiWindow, msg1, msg2)
}