remove one of the last duplicate code functions
this is almost complete 'clean' Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
5536e659ae
commit
f79fe8be57
1
area.go
1
area.go
|
@ -126,7 +126,6 @@ func ShowTextBox(gw *GuiWindow, newText *ui.AttributedString, custom func(*GuiBu
|
|||
hbox.SetPadded(true)
|
||||
|
||||
add(gw.BoxMap["MAINBOX"], newbox)
|
||||
// box := InitGuiBox(gw, nil, ui.NewVerticalBox(), "SplashArea3")
|
||||
|
||||
makeGenericArea(newbox, newText, custom)
|
||||
newbox.UiBox.Append(newbox.Window.Area.UiArea, true)
|
||||
|
|
23
box.go
23
box.go
|
@ -18,7 +18,9 @@ func add(box *GuiBox, newbox *GuiBox) {
|
|||
// create a new tab here
|
||||
// add the box to it as MAINBOX
|
||||
log.Println("\tgui.add() add to Window as a UiTab")
|
||||
newbox.Window.UiTab.InsertAt(newbox.Name, 0, newbox.UiBox)
|
||||
// TODO: allow passing where to append
|
||||
// newbox.Window.UiTab.InsertAt(newbox.Name, 0, newbox.UiBox)
|
||||
newbox.Window.UiTab.Append(newbox.Name, newbox.UiBox)
|
||||
newbox.Window.UiTab.SetMargined(0, true)
|
||||
|
||||
// TODO: figure out how to make a new Tab/Window/Box here
|
||||
|
@ -48,25 +50,6 @@ func add(box *GuiBox, newbox *GuiBox) {
|
|||
log.Println("gui.add() END")
|
||||
}
|
||||
|
||||
func InitGuiBox(gw *GuiWindow, box *GuiBox, uiBox *ui.Box, name string) *GuiBox {
|
||||
log.Println("InitGuiBox() START")
|
||||
var newGuiBox GuiBox
|
||||
newGuiBox.UiBox = uiBox
|
||||
newGuiBox.Window = gw
|
||||
uiBox.SetPadded(true)
|
||||
|
||||
if (box != nil) {
|
||||
log.Println("InitGuiBox() APPEND NEW BOX TO OLD BOX")
|
||||
box.UiBox.Append(uiBox, false)
|
||||
} else {
|
||||
log.Println("InitGuiBox() APPEND NEW BOX TO TAB")
|
||||
gw.UiTab.Append(name, uiBox)
|
||||
}
|
||||
gw.BoxMap[name] = &newGuiBox
|
||||
log.Println("InitGuiBox() END")
|
||||
return &newGuiBox
|
||||
}
|
||||
|
||||
func HardHorizontalBox(gw *GuiWindow) *GuiBox {
|
||||
log.Println("HardHorizontalBreak START")
|
||||
var newbox *GuiBox
|
||||
|
|
Loading…
Reference in New Issue