2022-10-16 10:09:16 -05:00
|
|
|
package toolkit
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
func (t *Toolkit) NewLabel(name string) *Toolkit {
|
2022-10-16 10:09:16 -05:00
|
|
|
// make new node here
|
|
|
|
log.Println("gui.Toolbox.NewLabel", name)
|
|
|
|
|
2022-10-21 11:40:08 -05:00
|
|
|
if t.broken() {
|
2022-10-19 13:23:22 -05:00
|
|
|
return nil
|
2022-10-16 10:09:16 -05:00
|
|
|
}
|
2022-10-19 13:23:22 -05:00
|
|
|
var newt Toolkit
|
|
|
|
newt.uiLabel = ui.NewLabel(name)
|
|
|
|
newt.uiBox = t.uiBox
|
|
|
|
t.uiBox.Append(newt.uiLabel, false)
|
2022-10-16 10:09:16 -05:00
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
return &newt
|
2022-10-16 10:09:16 -05:00
|
|
|
}
|