Hard to tell exactly from that but probably the new frame is the parent at that node.go:360 and it is not being initialized properly? Ki types require the "InitName" or equivalent method to be called, which sets their "This" member -- that is how we get proper virtual inheritance to work within Go..
Did you copy the paradigm of making an "AddNewX" method and use that to add the new type to the tree? just copy these lines and update to your type name, to register the type etc:
// Frame is a Layout that renders a background according to the
// background-color style setting, and optional striping for grid layouts
type Frame struct {
Layout
Stripes Stripes `desc:"options for striped backgrounds -- rendered as darker bands relative to background color"`
}
var KiT_Frame = kit.Types.AddType(&Frame{}, FrameProps)
// AddNewFrame adds a new frame to given parent node, with given name and layout
func AddNewFrame(parent ki.Ki, name string, layout Layouts) *Frame {
fr := parent.AddNewChild(KiT_Frame, name).(*Frame)
fr.Lay = layout
return fr
}
- Randy
> To view this discussion on the web visit
https://groups.google.com/d/msgid/goki-gi/b7c71c44-77c8-4c72-88c3-cc46ad1bb019n%40googlegroups.com.