1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-17 06:35:47 +01:00

bag tree finished.. updated code to new bags

This commit is contained in:
kojima
2000-03-29 02:17:39 +00:00
parent 8219011758
commit 9e45e85dc6
16 changed files with 691 additions and 283 deletions

View File

@@ -104,19 +104,17 @@ closestListItem(WMList *list, char *text, Bool exact)
{
WMListItem *item;
WMBag *items = WMGetListItems(list);
int i;
WMBagIterator i;
int len = strlen(text);
if (len==0)
return -1;
for (i = 0; i < WMGetBagItemCount(items); i++) {
item = WMGetFromBag(items, i);
WM_ITERATE_BAG(items, item, i) {
if (strlen(item->text) >= len &&
((exact && strcmp(item->text, text)==0) ||
(!exact && strncmp(item->text, text, len)==0))) {
return i;
return WMBagIndexForIterator(items, i);
}
}