ui/common/types.c

changeset 737
ac7f0869e8ae
parent 728
011d236c4a05
child 757
2b977b332582
equal deleted inserted replaced
736:3ad4792ffadc 737:ac7f0869e8ae
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) {

mercurial