* AxWin3 Interface Library
* - By John Hodge (thePowersGang)
*
- * main.c
- * - Entrypoint and setup
+ * r_widget.c
+ * - Widget window type interface
*/
#include <axwin3/axwin.h>
#include <axwin3/widget.h>
}
if( newID == info->nElements )
{
- info->nElements ++;
+ const int size_step = 4;
+ info->nElements += 4;
info->Elements = realloc(info->Elements, sizeof(*info->Elements)*info->nElements);
- newID = info->nElements - 1;
- _SysDebug("Expanded and allocated %i", newID);
+ newID = info->nElements - 4;
+ memset( &info->Elements[newID+1], 0, (size_step-1)*sizeof(info->Elements));
+ _SysDebug("Expanded to %i and allocated %i", info->nElements, newID);
}
else
_SysDebug("Allocated %i", newID);