diff options
| -rw-r--r-- | area.go | 17 | ||||
| -rw-r--r-- | gui.go | 2 | ||||
| -rw-r--r-- | misc.go | 6 | ||||
| -rw-r--r-- | structs.go | 1 |
4 files changed, 15 insertions, 11 deletions
@@ -17,18 +17,19 @@ func makeSplashArea(gb *GuiBox, newText *ui.AttributedString) { newB.Box = gb newB.GW = gb.Window + gw := gb.Window // initialize the GuiArea{} - gb.Area = new(GuiArea) - gb.Area.Button = newB - gb.Area.Box = gb - gb.Area.UiAttrstr = newText - gb.Area.UiArea = ui.NewArea(gb.Area) + gw.Area = new(GuiArea) + gw.Area.Button = newB + gw.Area.Box = gb + gw.Area.UiAttrstr = newText + gw.Area.UiArea = ui.NewArea(gw.Area) if (Data.Debug) { - spew.Dump(gb.Area.UiArea) + spew.Dump(gw.Area.UiArea) log.Println("DEBUGGING", Data.Debug) } else { - log.Println("NOT DEBUGGING AREA mhAH.Button =", gb.Area.Button) + log.Println("NOT DEBUGGING AREA mhAH.Button =", gw.Area.Button) } } @@ -128,7 +129,7 @@ func ShowTextBox(gw *GuiWindow, newText *ui.AttributedString) *GuiBox { gw.BoxMap["Splash"] = gb makeSplashArea(gb, newText) - newbox.Append(gb.Area.UiArea, true) + newbox.Append(gw.Area.UiArea, true) return gb } @@ -197,7 +197,7 @@ func CreateFontButton(box *GuiBox, action string) *GuiButton { newGB.Action = action newGB.FB = ui.NewFontButton() newGB.Box = box - newGB.Area = box.Area + newGB.Area = box.Window.Area Data.AllButtons = append(Data.AllButtons, &newGB) newGB.FB.OnChanged(func (*ui.FontButton) { @@ -36,10 +36,14 @@ func GuiInit() { }) } -func ShowMainTab(gw *GuiWindow) *GuiBox { +func AddMainTab(gw *GuiWindow) *GuiBox { log.Println("ShowMainTab() gw =", gw) log.Println("ShowMainTab() gw.UiTab =", gw.UiTab) + newWindow := new(GuiWindow) + newWindow.UiWindow = gw.UiWindow + Data.Windows = append(Data.Windows, newWindow) + var box *GuiBox box = new(GuiBox) box.Window = gw @@ -122,7 +122,6 @@ type GuiButton struct { type GuiBox struct { Window *GuiWindow EntryMap map[string]*GuiEntry - Area *GuiArea // andlabs/ui abstraction mapping UiBox *ui.Box |
