Hello,
Here comes the problem report for a problem that appeares in the current
Lesstif XmList implementation.
Lesstif version: current (both 1.2 and 2.x branches)
------------------
Problem description:
------------------------
Have a look at the simple user code:
=============================================
static void clear_order()
{
Arg arglist[5];
int ac = 0;
XtSetArg(arglist[ac], XmNitemCount, 0);
ac++;
/*
! XtSetArg(arglist[ac], XmNitems, NULL);
! ac++;
*/
XtSetArg(arglist[ac], XmNselectedItemCount, 0);
ac++;
XtSetValues(widget_array[k_total_order], arglist, ac);
}
=============================================
It produces the following warning message:
=============================================
Warning:
Name: total_order
Class: XmList
XmNitemCount and XmNitems must be set by the same XtSetValues.
=============================================
The XmList item list is not cleared, which is wrong.
Proper behaviour:
---------------------
If XmNitemCount is set to zero, the item list must be *silently*
cleared.
Problem resolution:
----------------------
Change the condition:
lib/Xm/List.c: 3438
if (List_ItemCount(old) != List_ItemCount(new_w) &&
List_Items(old) == List_Items(new_w))
{
to handle properly this case and add code that cleans up the item list
when the item count is being set to zero.
Verify, please, all other coupled attributes as well.
Regards,
Andrei