2022-10-19 13:23:22 -05:00
|
|
|
package toolkit
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
|
|
|
// create a new box
|
|
|
|
func (t *Toolkit) GetBox() *ui.Box {
|
|
|
|
return t.uiBox
|
|
|
|
}
|
|
|
|
|
|
|
|
// create a new box
|
|
|
|
func (t *Toolkit) NewBox() *Toolkit {
|
|
|
|
log.Println("gui.Toolbox.NewBox() START create default")
|
|
|
|
t.Dump()
|
|
|
|
if (t.uiGroup != nil) {
|
2022-10-21 11:40:08 -05:00
|
|
|
log.Println("\tgui.Toolbox.NewBox() is a Group")
|
2022-10-19 13:23:22 -05:00
|
|
|
var newTK Toolkit
|
|
|
|
|
|
|
|
vbox := ui.NewVerticalBox()
|
2022-10-21 11:40:08 -05:00
|
|
|
vbox.SetPadded(padded)
|
2022-10-19 13:23:22 -05:00
|
|
|
t.uiGroup.SetChild(vbox)
|
|
|
|
newTK.uiBox = vbox
|
|
|
|
|
|
|
|
return &newTK
|
|
|
|
}
|
|
|
|
if (t.uiBox != nil) {
|
2022-10-21 11:40:08 -05:00
|
|
|
log.Println("\tgui.Toolbox.NewBox() is a Box")
|
|
|
|
var newTK Toolkit
|
|
|
|
|
|
|
|
vbox := ui.NewVerticalBox()
|
|
|
|
vbox.SetPadded(padded)
|
|
|
|
t.uiBox.Append(vbox, stretchy)
|
|
|
|
newTK.uiBox = vbox
|
|
|
|
newTK.Name = t.Name
|
|
|
|
|
|
|
|
return &newTK
|
2022-10-19 13:23:22 -05:00
|
|
|
}
|
2022-10-21 11:40:08 -05:00
|
|
|
log.Println("\tgui.Toolbox.NewBox() FAILED. Couldn't figure out where to make a box")
|
2022-10-19 13:23:22 -05:00
|
|
|
t.Dump()
|
|
|
|
return nil
|
|
|
|
}
|