remove 'Action'

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-02 21:56:43 -07:00
parent 8fd3e719d9
commit a030afb2bd
4 changed files with 12 additions and 12 deletions

View File

@ -21,7 +21,7 @@ func WatchGUI() {
if (count > 20) {
log.Println("Sleep() in watchGUI() Data.State =", Data.State)
for i, window := range Data.Windows {
log.Println("watchGUI() Data.Windows", i, "Action =", window.Action)
log.Println("watchGUI() Data.Windows", i, "Name =", window.Name)
for name, abox := range window.BoxMap {
log.Printf("\twatchGUI() BOX mapname=%-12s abox.Name=%-12s", name, abox.Name)
/*

View File

@ -107,7 +107,7 @@ func defaultEntryChange(e *ui.Entry) {
}
if Data.AllEntries[key].UiEntry == e {
log.Println("defaultEntryChange() FOUND",
"action =", Data.AllEntries[key].Action,
"Name =", Data.AllEntries[key].Name,
"Last =", Data.AllEntries[key].Last,
"e.Text() =", e.Text())
Data.AllEntries[key].Last = e.Text()
@ -133,7 +133,7 @@ func defaultMakeEntry(startValue string, edit bool, action string) *GuiEntry {
var newEntry GuiEntry
newEntry.UiEntry = e
newEntry.Edit = edit
newEntry.Action = action
newEntry.Name = action
if (action == "INT") {
newEntry.Normalize = normalizeInt
}

6
gui.go
View File

@ -22,7 +22,7 @@ func InitGuiWindow(action string, gw *GuiWindow) *GuiWindow {
var newGuiWindow GuiWindow
newGuiWindow.Width = Config.Width
newGuiWindow.Height = Config.Height
newGuiWindow.Action = action
// newGuiWindow.Action = action
newGuiWindow.MakeWindow = gw.MakeWindow
newGuiWindow.UiWindow = gw.UiWindow
newGuiWindow.UiTab = gw.UiTab
@ -40,13 +40,13 @@ func StartNewWindow(bg bool, action string, callback func(*GuiWindow) *GuiBox) {
log.Println("StartNewWindow() Create a new window")
var junk GuiWindow
junk.MakeWindow = callback
junk.Action = action
// junk.Action = action
window := InitGuiWindow(action, &junk)
if (bg) {
log.Println("StartNewWindow() START NEW GOROUTINE for ui.Main()")
go ui.Main(func() {
log.Println("gui.StartNewWindow() inside ui.Main()")
InitTabWindow(window)
go InitTabWindow(window)
})
time.Sleep(2000 * time.Millisecond) // this might make it more stable on windows?
} else {

View File

@ -60,7 +60,8 @@ type GuiData struct {
// can destroy and replace it with something else
//
type GuiWindow struct {
Action string
Name string // field for human readable name
// Action string
Width int
Height int
@ -80,8 +81,8 @@ type GuiWindow struct {
// GuiBox is any type of ui.Hbox or ui.Vbox
// There can be lots of these for each GuiWindow
type GuiBox struct {
Name string // field for human readable name
Window *GuiWindow
Name string
// andlabs/ui abstraction mapping
UiBox *ui.Box
@ -99,8 +100,6 @@ type GuiButton struct {
Custom func (*GuiButton)
Values interface {}
// Action string // what type of button
// andlabs/ui abstraction mapping
B *ui.Button
FB *ui.FontButton
@ -108,9 +107,10 @@ type GuiButton struct {
// text entry fields
type GuiEntry struct {
Action string // what type of button
Name string // field for human readable name
// Action string // what type of button
Edit bool
Last string // the last value
Last string // the last value
Normalize func (string) string // function to 'normalize' the data
B *GuiButton