| 625 } |
625 } |
| 626 return (UiListSelection){ 0, NULL }; |
626 return (UiListSelection){ 0, NULL }; |
| 627 } |
627 } |
| 628 |
628 |
| 629 UIEXPORT void ui_list_setselection(UiList *list, int index) { |
629 UIEXPORT void ui_list_setselection(UiList *list, int index) { |
| 630 if (list->setselection && index >= 0) { |
630 if (list->setselection) { |
| 631 UiListSelection sel; |
631 UiListSelection sel = { 0, NULL }; |
| 632 sel.count = 1; |
632 if(index >= 0) { |
| 633 sel.rows = &index; |
633 sel.count = 1; |
| |
634 sel.rows = &index; |
| |
635 } |
| 634 list->setselection(list, sel); |
636 list->setselection(list, sel); |
| 635 } |
637 } |
| 636 } |
638 } |
| 637 |
639 |
| 638 UIEXPORT void ui_listselection_free(UiListSelection selection) { |
640 UIEXPORT void ui_listselection_free(UiListSelection selection) { |