parent
8fd3e719d9
commit
a030afb2bd
2
debug.go
2
debug.go
|
@ -21,7 +21,7 @@ func WatchGUI() {
|
||||||
if (count > 20) {
|
if (count > 20) {
|
||||||
log.Println("Sleep() in watchGUI() Data.State =", Data.State)
|
log.Println("Sleep() in watchGUI() Data.State =", Data.State)
|
||||||
for i, window := range Data.Windows {
|
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 {
|
for name, abox := range window.BoxMap {
|
||||||
log.Printf("\twatchGUI() BOX mapname=%-12s abox.Name=%-12s", name, abox.Name)
|
log.Printf("\twatchGUI() BOX mapname=%-12s abox.Name=%-12s", name, abox.Name)
|
||||||
/*
|
/*
|
||||||
|
|
4
entry.go
4
entry.go
|
@ -107,7 +107,7 @@ func defaultEntryChange(e *ui.Entry) {
|
||||||
}
|
}
|
||||||
if Data.AllEntries[key].UiEntry == e {
|
if Data.AllEntries[key].UiEntry == e {
|
||||||
log.Println("defaultEntryChange() FOUND",
|
log.Println("defaultEntryChange() FOUND",
|
||||||
"action =", Data.AllEntries[key].Action,
|
"Name =", Data.AllEntries[key].Name,
|
||||||
"Last =", Data.AllEntries[key].Last,
|
"Last =", Data.AllEntries[key].Last,
|
||||||
"e.Text() =", e.Text())
|
"e.Text() =", e.Text())
|
||||||
Data.AllEntries[key].Last = e.Text()
|
Data.AllEntries[key].Last = e.Text()
|
||||||
|
@ -133,7 +133,7 @@ func defaultMakeEntry(startValue string, edit bool, action string) *GuiEntry {
|
||||||
var newEntry GuiEntry
|
var newEntry GuiEntry
|
||||||
newEntry.UiEntry = e
|
newEntry.UiEntry = e
|
||||||
newEntry.Edit = edit
|
newEntry.Edit = edit
|
||||||
newEntry.Action = action
|
newEntry.Name = action
|
||||||
if (action == "INT") {
|
if (action == "INT") {
|
||||||
newEntry.Normalize = normalizeInt
|
newEntry.Normalize = normalizeInt
|
||||||
}
|
}
|
||||||
|
|
6
gui.go
6
gui.go
|
@ -22,7 +22,7 @@ func InitGuiWindow(action string, gw *GuiWindow) *GuiWindow {
|
||||||
var newGuiWindow GuiWindow
|
var newGuiWindow GuiWindow
|
||||||
newGuiWindow.Width = Config.Width
|
newGuiWindow.Width = Config.Width
|
||||||
newGuiWindow.Height = Config.Height
|
newGuiWindow.Height = Config.Height
|
||||||
newGuiWindow.Action = action
|
// newGuiWindow.Action = action
|
||||||
newGuiWindow.MakeWindow = gw.MakeWindow
|
newGuiWindow.MakeWindow = gw.MakeWindow
|
||||||
newGuiWindow.UiWindow = gw.UiWindow
|
newGuiWindow.UiWindow = gw.UiWindow
|
||||||
newGuiWindow.UiTab = gw.UiTab
|
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")
|
log.Println("StartNewWindow() Create a new window")
|
||||||
var junk GuiWindow
|
var junk GuiWindow
|
||||||
junk.MakeWindow = callback
|
junk.MakeWindow = callback
|
||||||
junk.Action = action
|
// junk.Action = action
|
||||||
window := InitGuiWindow(action, &junk)
|
window := InitGuiWindow(action, &junk)
|
||||||
if (bg) {
|
if (bg) {
|
||||||
log.Println("StartNewWindow() START NEW GOROUTINE for ui.Main()")
|
log.Println("StartNewWindow() START NEW GOROUTINE for ui.Main()")
|
||||||
go ui.Main(func() {
|
go ui.Main(func() {
|
||||||
log.Println("gui.StartNewWindow() inside ui.Main()")
|
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?
|
time.Sleep(2000 * time.Millisecond) // this might make it more stable on windows?
|
||||||
} else {
|
} else {
|
||||||
|
|
10
structs.go
10
structs.go
|
@ -60,7 +60,8 @@ type GuiData struct {
|
||||||
// can destroy and replace it with something else
|
// can destroy and replace it with something else
|
||||||
//
|
//
|
||||||
type GuiWindow struct {
|
type GuiWindow struct {
|
||||||
Action string
|
Name string // field for human readable name
|
||||||
|
// Action string
|
||||||
Width int
|
Width int
|
||||||
Height int
|
Height int
|
||||||
|
|
||||||
|
@ -80,8 +81,8 @@ type GuiWindow struct {
|
||||||
// GuiBox is any type of ui.Hbox or ui.Vbox
|
// GuiBox is any type of ui.Hbox or ui.Vbox
|
||||||
// There can be lots of these for each GuiWindow
|
// There can be lots of these for each GuiWindow
|
||||||
type GuiBox struct {
|
type GuiBox struct {
|
||||||
|
Name string // field for human readable name
|
||||||
Window *GuiWindow
|
Window *GuiWindow
|
||||||
Name string
|
|
||||||
|
|
||||||
// andlabs/ui abstraction mapping
|
// andlabs/ui abstraction mapping
|
||||||
UiBox *ui.Box
|
UiBox *ui.Box
|
||||||
|
@ -99,8 +100,6 @@ type GuiButton struct {
|
||||||
Custom func (*GuiButton)
|
Custom func (*GuiButton)
|
||||||
Values interface {}
|
Values interface {}
|
||||||
|
|
||||||
// Action string // what type of button
|
|
||||||
|
|
||||||
// andlabs/ui abstraction mapping
|
// andlabs/ui abstraction mapping
|
||||||
B *ui.Button
|
B *ui.Button
|
||||||
FB *ui.FontButton
|
FB *ui.FontButton
|
||||||
|
@ -108,7 +107,8 @@ type GuiButton struct {
|
||||||
|
|
||||||
// text entry fields
|
// text entry fields
|
||||||
type GuiEntry struct {
|
type GuiEntry struct {
|
||||||
Action string // what type of button
|
Name string // field for human readable name
|
||||||
|
// Action string // what type of button
|
||||||
Edit bool
|
Edit bool
|
||||||
Last string // the last value
|
Last string // the last value
|
||||||
Normalize func (string) string // function to 'normalize' the data
|
Normalize func (string) string // function to 'normalize' the data
|
||||||
|
|
Loading…
Reference in New Issue