MCPcopy Create free account
hub / github.com/cogentcore/core / newParts

Method newParts

core/widget.go:350–362  ·  view source on GitHub ↗

newParts makes the [WidgetBase.Parts] if they don't already exist. It returns the parts regardless.

()

Source from the content-addressed store, hash-verified

348// newParts makes the [WidgetBase.Parts] if they don't already exist.
349// It returns the parts regardless.
350func (wb *WidgetBase) newParts() *Frame {
351 if wb.Parts != nil {
352 return wb.Parts
353 }
354 wb.Parts = NewFrame()
355 wb.Parts.SetName("parts")
356 tree.SetParent(wb.Parts, wb) // don't add to children list
357 wb.Parts.Styler(func(s *styles.Style) {
358 s.Grow.Set(1, 1)
359 s.RenderBox = false
360 })
361 return wb.Parts
362}
363
364// parentWidget returns the parent as a [WidgetBase] or nil
365// if this is the root and has no parent.

Callers 3

InitMethod · 0.80
InitMethod · 0.80
addDialogPartsMethod · 0.80

Calls 5

SetParentFunction · 0.92
NewFrameFunction · 0.85
StylerMethod · 0.80
SetNameMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected