SetSelected selects or unselects the specified item
(item IPanel, state bool)
| 195 | |
| 196 | // SetSelected selects or unselects the specified item |
| 197 | func (li *List) SetSelected(item IPanel, state bool) { |
| 198 | |
| 199 | for _, curr := range li.items { |
| 200 | litem := curr.(*ListItem) |
| 201 | if litem.item == item { |
| 202 | litem.SetSelected(state) |
| 203 | li.update() |
| 204 | li.Dispatch(OnChange, nil) |
| 205 | return |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | // SelectPos selects or unselects the item at the specified position |
| 211 | func (li *List) SelectPos(pos int, state bool) { |