499 return list->getselection(list); |
499 return list->getselection(list); |
500 } |
500 } |
501 return (UiListSelection){ 0, NULL }; |
501 return (UiListSelection){ 0, NULL }; |
502 } |
502 } |
503 |
503 |
|
504 UIEXPORT void ui_list_setselection(UiList *list, int index) { |
|
505 if (list->setselection && index >= 0) { |
|
506 UiListSelection sel; |
|
507 sel.count = 1; |
|
508 sel.rows = &index; |
|
509 list->setselection(list, sel); |
|
510 } |
|
511 } |
|
512 |
504 UIEXPORT void ui_listselection_free(UiListSelection selection) { |
513 UIEXPORT void ui_listselection_free(UiListSelection selection) { |
505 if (selection.rows) { |
514 if (selection.rows) { |
506 free(selection.rows); |
515 free(selection.rows); |
507 } |
516 } |
508 } |
517 } |