diff --git a/Makefile b/Makefile index 31212b9..df5d201 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ # should update every go dependancy (?) update: - git pull - GO111MODULE="off" go get -v -t -u ./... + # git pull + wit go update + # go get -v -t -u ./... diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c72bbca --- /dev/null +++ b/go.mod @@ -0,0 +1,9 @@ +module git.wit.org/wit/gui + +go 1.17 + +require ( + github.com/andlabs/ui v0.0.0-20200610043537-70a69d6ae31e + github.com/davecgh/go-spew v1.1.1 + golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..27ff5d2 --- /dev/null +++ b/go.sum @@ -0,0 +1,8 @@ +github.com/andlabs/ui v0.0.0-20200610043537-70a69d6ae31e h1:wSQCJiig/QkoUnpvelSPbLiZNWvh2yMqQTQvIQqSUkU= +github.com/andlabs/ui v0.0.0-20200610043537-70a69d6ae31e/go.mod h1:5G2EjwzgZUPnnReoKvPWVneT8APYbyKkihDVAHUi0II= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/structs.go b/structs.go index 59190f6..ac67588 100644 --- a/structs.go +++ b/structs.go @@ -44,6 +44,12 @@ type GuiData struct { buttonMap map[*ui.Button]*GuiButton } +type GuiTab struct { + Name string // field for human readable name + Number int // the andlabs/ui tab index + Window *GuiWindow // the parent Window +} + // // stores information on the 'window' // diff --git a/window.go b/window.go index da4f1a8..a6c5b4f 100644 --- a/window.go +++ b/window.go @@ -148,6 +148,7 @@ func CreateWindow(title string, tabname string, x int, y int, custom func() ui.C func CreateBlankWindow(title string, x int, y int) *GuiBox { box := mapWindow(nil, title, x, y) + log.Println("gui.CreateBlankWindow() title = box.Name =", box.Name) window := ui.NewWindow(box.Name, x, y, false) window.SetBorderless(false) @@ -178,6 +179,7 @@ func initBlankWindow() ui.Control { var master = 0 func mapWindow(window *ui.Window, title string, x int, y int) *GuiBox { + log.Println("gui.WindowMap START title =", title) if (Data.WindowMap[title] != nil) { log.Println("Data.WindowMap[title] already exists title =", title) master = master + 1 @@ -188,6 +190,7 @@ func mapWindow(window *ui.Window, title string, x int, y int) *GuiBox { panic("Data.WindowMap[newGuiWindow.Name] already exists") return nil } + log.Println("gui.WindowMap START title =", title) var newGuiWindow GuiWindow newGuiWindow.Width = x newGuiWindow.Height = y @@ -201,6 +204,7 @@ func mapWindow(window *ui.Window, title string, x int, y int) *GuiBox { var box GuiBox box.Window = &newGuiWindow + box.Name = title return &box }