diff -r 3e8b5c9b4033 -r e4198fc2ead4 ui/motif/list.c --- a/ui/motif/list.c Sun May 11 10:41:29 2014 +0200 +++ b/ui/motif/list.c Sun May 11 11:35:33 2014 +0200 @@ -47,21 +47,14 @@ UIWIDGET ui_listview_var(UiObject *obj, UiListPtr *list, ui_model_getvalue_f getvalue, ui_callback f, void *udata) { UiList *ls = list->list; - //int count; - //XmStringTable items = ui_create_stringlist(list->list, getvalue, &count); - int count = list->list->count(list->list); - XmStringTable items = (XmStringTable)XtMalloc(count * sizeof(XmString)); - void *data = list->list->first(list->list); - for(int i=0;ilist->next(list->list); - } + int count; + XmStringTable items = ui_create_stringlist(list->list, getvalue, &count); Arg args[8]; int n = 0; XtSetArg(args[n], XmNitemCount, count); n++; - XtSetArg(args[n], XmNitems, NULL); + XtSetArg(args[n], XmNitems, count == 0 ? NULL : items); n++; UiContainer *ct = uic_get_current_container(obj); @@ -142,7 +135,12 @@ view->getvalue, &count); - XtVaSetValues(view->widget, XmNitems, items, XmNitemCount, count, NULL); + XtVaSetValues( + view->widget, + XmNitems, count == 0 ? NULL : items, + XmNitemCount, + count, + NULL); for (int i=0;i