newParts makes the [WidgetBase.Parts] if they don't already exist. It returns the parts regardless.
()
| 348 | // newParts makes the [WidgetBase.Parts] if they don't already exist. |
| 349 | // It returns the parts regardless. |
| 350 | func (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. |