[comp.sys.hp] Bug in HP Widget RowCol Manager. Fix included.

irf@kuling.UUCP (Bo Thide') (11/01/89)

We found a bug in the HP-UX 6.5 version of X Widgets.  When displaying
more than two rows of three columns with XtNforceSize the sizes of the
individual rowcol elements (for instance buttons) become unpredictable.

We looked at the source code, found the bug, compiled it and it worked
without this problem.  Here is a fragment of the RCManager.c file showing,
near the bottom, how we replaced an incorrect line with a correct one.


/**   File:        RCManager.c
 **
 **   Project:     X Widgets

:
:
:

static void XwForceSize (mw, layoutList, layoutCount, columnCount, rowCount)
XwRowColWidget mw;
XwRCLayoutList layoutList[];
int layoutCount;
int columnCount;
int rowCount;

{
:
:
:

   /*  Force the heights in each of the rows to be the same  */

   i = 0;
   while (i < layoutCount)
   {
      for (j = i, size = 0;
	   layoutList[j].y == layoutList[i].y && 
           layoutList[j].widget != NULL       &&
           j < layoutCount;
           j++)
	 size = Max (size, layoutList[j].height);

      for (k = i; k < j; k++)
	 layoutList[k].height = size;

      /* old line  i += j; */
      i = j; /* <--------- changed Oct 24, 1989 by Anders Lundgren */
   }
}
:
:
: