insertNewTab inserts a new tab with the given label at the given index position within the list of tabs and returns the resulting tab frame. An optional icon can also be passed for the tab button.
(label string, idx int, icon ...icons.Icon)
| 208 | // within the list of tabs and returns the resulting tab frame. An optional icon |
| 209 | // can also be passed for the tab button. |
| 210 | func (ts *Tabs) insertNewTab(label string, idx int, icon ...icons.Icon) *Frame { |
| 211 | tfr := ts.getFrame() |
| 212 | frame := NewFrame() |
| 213 | tfr.InsertChild(frame, idx) |
| 214 | frame.SetName(label) |
| 215 | frame.Styler(func(s *styles.Style) { |
| 216 | s.Direction = styles.Column |
| 217 | }) |
| 218 | ts.insertTabOnlyAt(label, idx, icon...) |
| 219 | ts.Update() |
| 220 | return frame |
| 221 | } |
| 222 | |
| 223 | // insertTabOnlyAt inserts just the tab button at given index, after the panel has |
| 224 | // already been added to the frame; assumed to be wrapped in update. Generally |
no test coverage detected