/* * This function sets the information inside the file selector. */ void setCDKAlphalistContents (CDKALPHALIST *alphalist, char *list[], int listSize) { /* Declare local variables. */ CDKSCROLL *scrollp = (CDKSCROLL *)alphalist->scrollField; CDKENTRY *entry = (CDKENTRY *)alphalist->entryField; int x; freeCharList (alphalist->list, alphalist->listSize); /* We need to sort the list before we use it. */ sortList (list, listSize); /* Copy in the new information. */ alphalist->listSize = listSize; for (x=0; x < listSize; x++) { alphalist->list[x] = copyChar (list[x]); } /* Set the information in the scrolling list. */ setCDKScroll (scrollp, list, listSize, NONUMBERS, scrollp->highlight, ObjOf(scrollp)->box); /* Clean out the entry field. */ cleanCDKEntry (entry); /* Redraw the alphalist. */ eraseCDKAlphalist (alphalist); drawCDKAlphalist (alphalist, ObjOf(alphalist)->box); }
/* * This function sets the information inside the file selector. */ void setCDKAlphalistContents (CDKALPHALIST *widget, char **list, int listSize) { CDKSCROLL *scrollp = widget->scrollField; CDKENTRY *entry = widget->entryField; if (!createList (widget, list, listSize)) return; /* Set the information in the scrolling list. */ setCDKScroll (scrollp, widget->list, widget->listSize, NONUMBERS, scrollp->highlight, ObjOf (scrollp)->box); /* Clean out the entry field. */ setCDKAlphalistCurrentItem (widget, 0); cleanCDKEntry (entry); /* Redraw the widget. */ eraseCDKAlphalist (widget); drawCDKAlphalist (widget, ObjOf (widget)->box); }