summaryrefslogtreecommitdiff
path: root/box.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-06-03 00:50:05 -0700
committerJeff Carr <[email protected]>2019-06-03 00:50:05 -0700
commit0e60af56dc487416f179e196f0421721d4437fc7 (patch)
tree91fa7aa5ff43f0b66eafcc77d71ce316a811bce6 /box.go
parent5a5e4b098df074e5d15713fe79a857bdae4b17d3 (diff)
more button cleanups
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'box.go')
-rw-r--r--box.go39
1 files changed, 13 insertions, 26 deletions
diff --git a/box.go b/box.go
index 68f2122..3121257 100644
--- a/box.go
+++ b/box.go
@@ -63,41 +63,26 @@ func add(box *GuiBox, newbox *GuiBox) {
log.Println("gui.add() END")
}
-/*
-func HardHorizontalBox(gw *GuiWindow) *GuiBox {
- log.Println("HardHorizontalBreak START")
-
- box := gw.BoxMap["MAINBOX"]
- if (box != nil) { HorizontalBreak(box) }
-
- var newbox *GuiBox
- newbox = new(GuiBox)
- newbox.Window = gw
- hbox := ui.NewVerticalBox()
- hbox.SetPadded(true)
- newbox.UiBox = hbox
- newbox.Name = "Hbox1 HARD"
- add(gw.BoxMap["MAINBOX"], newbox)
- log.Println("HardHorizontalBreak END")
- return newbox
-}
-*/
-
-func VerticalBox(box *GuiBox, name string) *GuiBox {
+func NewBox(box *GuiBox, axis int, name string) *GuiBox {
log.Println("VerticalBox START")
var newbox *GuiBox
newbox = new(GuiBox)
newbox.Window = box.Window
newbox.Name = name
- vbox := ui.NewVerticalBox()
- vbox.SetPadded(true)
- newbox.UiBox = vbox
+ var uiBox *ui.Box
+ if (axis == Xaxis) {
+ uiBox = ui.NewHorizontalBox()
+ } else {
+ uiBox = ui.NewVerticalBox()
+ }
+ uiBox.SetPadded(true)
+ newbox.UiBox = uiBox
add(box, newbox)
return newbox
}
-func HardBox(gw *GuiWindow, axis int) *GuiBox {
+func HardBox(gw *GuiWindow, axis int, name string) *GuiBox {
log.Println("HardBox() START axis =", axis)
// add a Vertical Seperator if there is already a box
@@ -124,7 +109,7 @@ func HardBox(gw *GuiWindow, axis int) *GuiBox {
newbox := new(GuiBox)
newbox.Window = gw
newbox.UiBox = uiBox
- newbox.Name = "Vbox1 HARD"
+ newbox.Name = name
add(gw.BoxMap["MAINBOX"], newbox)
@@ -144,6 +129,7 @@ func VerticalBreak(box *GuiBox) {
box.UiBox.Append(tmp, false)
}
+/*
func AddGenericBox(gw *GuiWindow, name string) *GuiBox {
log.Println("AddGenericBox() START name =", name)
// create a new vertical box off of the mainbox
@@ -170,3 +156,4 @@ func AddGenericBox(gw *GuiWindow, name string) *GuiBox {
return newbox
}
+*/