Patch to make RDF menus a lot faster. They are a lot faster now!

Thanks to skinny <skinny@knowhere.net> for providing the patch.
This commit is contained in:
ramiro%netscape.com 1998-10-12 06:26:30 +00:00
Родитель 22ee9b07da
Коммит edcdf8c318
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -459,8 +459,12 @@ XFE_RDFMenuToolbarBase::createItemTree(Widget menu,HT_Resource entry)
{
XP_ASSERT( HT_IsContainer(entry) );
int numItems = 0;
D(printf("Create tree: %s\n",HT_GetNodeName(entry)));
HT_SetOpenState(entry, PR_TRUE);
int numAlloc = HT_GetCountVisibleChildren(entry);
Widget* wItems = (Widget*) calloc(numAlloc, sizeof(Widget));
HT_Cursor child_cursor = HT_NewCursor(entry);
HT_Resource child;
while ( (child = HT_GetNextItem(child_cursor)) )
@ -486,10 +490,12 @@ XFE_RDFMenuToolbarBase::createItemTree(Widget menu,HT_Resource entry)
if (item)
{
XP_ASSERT( XfeIsAlive(item) );
XtManageChild(item);
wItems[numItems++] = item;
}
}
XtManageChildren(wItems, numItems);
free(wItems);
wItems = NULL;
HT_DeleteCursor(child_cursor);
}
//////////////////////////////////////////////////////////////////////////