blob: 453412a26ded08c579ead21b71b1f76d68aa588d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package toolkit
import "log"
import "os"
import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"
// func NewLabel(b *ui.Box, name string) *Toolkit {
func (t *Toolkit) NewLabel(name string) *Toolkit {
// make new node here
log.Println("gui.Toolbox.NewLabel", name)
if (t.uiBox == nil) {
log.Println("gui.ToolboxNode.NewLabel() node.UiBox == nil. I can't add a range UI element without a place to put it")
os.Exit(0)
return nil
}
var newt Toolkit
newt.uiLabel = ui.NewLabel(name)
newt.uiBox = t.uiBox
t.uiBox.Append(newt.uiLabel, false)
log.Println("parent toolkit")
t.Dump()
log.Println("newt toolkit")
newt.Dump()
// panic("got here")
return &newt
}
|