102 |
102 |
103 list->data = cxArrayListCreate(cxDefaultAllocator, NULL, CX_STORE_POINTERS, 32); |
103 list->data = cxArrayListCreate(cxDefaultAllocator, NULL, CX_STORE_POINTERS, 32); |
104 list->iter = NULL; |
104 list->iter = NULL; |
105 |
105 |
106 list->update = NULL; |
106 list->update = NULL; |
|
107 list->getselection = NULL; |
107 list->obj = NULL; |
108 list->obj = NULL; |
108 |
109 |
109 if(name) { |
110 if(name) { |
110 uic_reg_var(ctx, name, UI_VAR_LIST, list); |
111 uic_reg_var(ctx, name, UI_VAR_LIST, list); |
111 } |
112 } |
456 l->update = NULL; |
457 l->update = NULL; |
457 l->obj = NULL; |
458 l->obj = NULL; |
458 } |
459 } |
459 |
460 |
460 |
461 |
|
462 UIEXPORT UiListSelection ui_list_getselection(UiList *list) { |
|
463 if (list->getselection) { |
|
464 return list->getselection(list); |
|
465 } |
|
466 return (UiListSelection){ 0, NULL }; |
|
467 } |
|
468 |
|
469 UIEXPORT void ui_listselection_free(UiListSelection selection) { |
|
470 if (selection.rows) { |
|
471 free(selection.rows); |
|
472 } |
|
473 } |
461 |
474 |
462 UIEXPORT UiStr ui_str(char *cstr) { |
475 UIEXPORT UiStr ui_str(char *cstr) { |
463 return (UiStr) { cstr, NULL }; |
476 return (UiStr) { cstr, NULL }; |
464 } |
477 } |
465 |
478 |