start handling 'Guiwindow' correctly
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
20a402f106
commit
a941c5a0f1
17
area.go
17
area.go
|
@ -17,18 +17,19 @@ func makeSplashArea(gb *GuiBox, newText *ui.AttributedString) {
|
||||||
newB.Box = gb
|
newB.Box = gb
|
||||||
newB.GW = gb.Window
|
newB.GW = gb.Window
|
||||||
|
|
||||||
|
gw := gb.Window
|
||||||
// initialize the GuiArea{}
|
// initialize the GuiArea{}
|
||||||
gb.Area = new(GuiArea)
|
gw.Area = new(GuiArea)
|
||||||
gb.Area.Button = newB
|
gw.Area.Button = newB
|
||||||
gb.Area.Box = gb
|
gw.Area.Box = gb
|
||||||
gb.Area.UiAttrstr = newText
|
gw.Area.UiAttrstr = newText
|
||||||
gb.Area.UiArea = ui.NewArea(gb.Area)
|
gw.Area.UiArea = ui.NewArea(gw.Area)
|
||||||
|
|
||||||
if (Data.Debug) {
|
if (Data.Debug) {
|
||||||
spew.Dump(gb.Area.UiArea)
|
spew.Dump(gw.Area.UiArea)
|
||||||
log.Println("DEBUGGING", Data.Debug)
|
log.Println("DEBUGGING", Data.Debug)
|
||||||
} else {
|
} 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
|
gw.BoxMap["Splash"] = gb
|
||||||
|
|
||||||
makeSplashArea(gb, newText)
|
makeSplashArea(gb, newText)
|
||||||
newbox.Append(gb.Area.UiArea, true)
|
newbox.Append(gw.Area.UiArea, true)
|
||||||
|
|
||||||
return gb
|
return gb
|
||||||
}
|
}
|
||||||
|
|
2
gui.go
2
gui.go
|
@ -197,7 +197,7 @@ func CreateFontButton(box *GuiBox, action string) *GuiButton {
|
||||||
newGB.Action = action
|
newGB.Action = action
|
||||||
newGB.FB = ui.NewFontButton()
|
newGB.FB = ui.NewFontButton()
|
||||||
newGB.Box = box
|
newGB.Box = box
|
||||||
newGB.Area = box.Area
|
newGB.Area = box.Window.Area
|
||||||
Data.AllButtons = append(Data.AllButtons, &newGB)
|
Data.AllButtons = append(Data.AllButtons, &newGB)
|
||||||
|
|
||||||
newGB.FB.OnChanged(func (*ui.FontButton) {
|
newGB.FB.OnChanged(func (*ui.FontButton) {
|
||||||
|
|
6
misc.go
6
misc.go
|
@ -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 =", gw)
|
||||||
log.Println("ShowMainTab() gw.UiTab =", gw.UiTab)
|
log.Println("ShowMainTab() gw.UiTab =", gw.UiTab)
|
||||||
|
|
||||||
|
newWindow := new(GuiWindow)
|
||||||
|
newWindow.UiWindow = gw.UiWindow
|
||||||
|
Data.Windows = append(Data.Windows, newWindow)
|
||||||
|
|
||||||
var box *GuiBox
|
var box *GuiBox
|
||||||
box = new(GuiBox)
|
box = new(GuiBox)
|
||||||
box.Window = gw
|
box.Window = gw
|
||||||
|
|
|
@ -122,7 +122,6 @@ type GuiButton struct {
|
||||||
type GuiBox struct {
|
type GuiBox struct {
|
||||||
Window *GuiWindow
|
Window *GuiWindow
|
||||||
EntryMap map[string]*GuiEntry
|
EntryMap map[string]*GuiEntry
|
||||||
Area *GuiArea
|
|
||||||
|
|
||||||
// andlabs/ui abstraction mapping
|
// andlabs/ui abstraction mapping
|
||||||
UiBox *ui.Box
|
UiBox *ui.Box
|
||||||
|
|
Loading…
Reference in New Issue