| 2315 | |
| 2316 | template <typename S> |
| 2317 | void list_box<S>:: |
| 2318 | select ( |
| 2319 | unsigned long index |
| 2320 | ) |
| 2321 | { |
| 2322 | auto_mutex M(m); |
| 2323 | DLIB_ASSERT ( index < size() , |
| 2324 | "\tvoid list_box::select(index)" |
| 2325 | << "\n\tindex: " << index |
| 2326 | << "\n\tsize(): " << size() ); |
| 2327 | |
| 2328 | last_selected = index; |
| 2329 | items[index].is_selected = true; |
| 2330 | parent.invalidate_rectangle(rect); |
| 2331 | } |
| 2332 | |
| 2333 | // ---------------------------------------------------------------------------------------- |
| 2334 |