RecycleTabWidget returns a tab with the given widget type in the tab frame, first by looking for an existing one with the given name, and if not found, making and configuring a new one. It returns the resulting widget.
(ts *Tabs, name string)
| 336 | // first by looking for an existing one with the given name, and if not found, |
| 337 | // making and configuring a new one. It returns the resulting widget. |
| 338 | func RecycleTabWidget[T tree.NodeValue](ts *Tabs, name string) *T { |
| 339 | fr := ts.RecycleTab(name) |
| 340 | if fr.HasChildren() { |
| 341 | return any(fr.Child(0)).(*T) |
| 342 | } |
| 343 | w := tree.New[T](fr) |
| 344 | any(w).(Widget).AsWidget().UpdateWidget() |
| 345 | return w |
| 346 | } |
| 347 | |
| 348 | // deleteTabIndex deletes the tab at the given index, returning whether it was successful. |
| 349 | func (ts *Tabs) deleteTabIndex(idx int) bool { |
nothing calls this directly
no test coverage detected