(item Widget)
| 63 | } |
| 64 | |
| 65 | func (l *WidgetList) Index(item Widget) int { |
| 66 | wb := item.AsWidgetBase() |
| 67 | |
| 68 | for i, widget := range l.items { |
| 69 | if widget == wb { |
| 70 | return i |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | return -1 |
| 75 | } |
| 76 | |
| 77 | func (l *WidgetList) Contains(item Widget) bool { |
| 78 | return l.Index(item) > -1 |
no test coverage detected