2022-10-17 22:39:03 -05:00
|
|
|
package toolkit
|
|
|
|
|
|
|
|
import "log"
|
2022-10-19 13:23:22 -05:00
|
|
|
import "os"
|
2022-10-17 22:39:03 -05:00
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
|
|
|
// make new Group here
|
2022-10-19 13:23:22 -05:00
|
|
|
func (t Toolkit) NewGroup(title string) *Toolkit {
|
|
|
|
var newt Toolkit
|
|
|
|
|
|
|
|
if (t.uiBox == nil) {
|
|
|
|
log.Println("gui.ToolboxNode.NewGroup() node.UiBox == nil. I can't add a range UI element without a place to put it")
|
|
|
|
log.Println("probably could just make a box here?")
|
|
|
|
os.Exit(0)
|
|
|
|
return nil
|
2022-10-17 22:39:03 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
log.Println("gui.Toolbox.NewGroup() create", title)
|
|
|
|
g := ui.NewGroup(title)
|
|
|
|
g.SetMargined(true)
|
2022-10-19 13:23:22 -05:00
|
|
|
t.uiBox.Append(g, streachy)
|
2022-10-17 22:39:03 -05:00
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
hbox := ui.NewVerticalBox()
|
|
|
|
hbox.SetPadded(true)
|
|
|
|
g.SetChild(hbox)
|
2022-10-17 22:39:03 -05:00
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
newt.uiGroup = g
|
|
|
|
newt.uiBox = hbox
|
|
|
|
newt.Name = title
|
2022-10-17 22:39:03 -05:00
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
t.Dump()
|
|
|
|
newt.Dump()
|
|
|
|
// panic("toolkit.NewGroup")
|
|
|
|
return &newt
|
2022-10-17 22:39:03 -05:00
|
|
|
}
|