#include #include /* we need to get inside the list. this is illegal */ void XmListGetSelectedPositions(w,return_table, return_count) XmListWidget w; int **return_table; int *return_count; { int i,j; int *table; if (w->list.selectedItemCount == 0) { *return_table = NULL; *return_count = 0; return; } table = (int *) XtMalloc(w->list.selectedItemCount * sizeof(int)); for (i=j=0; i < w->list.itemCount; i++) { if (w->list.InternalList[i]->selected) table[j++] = i; } *return_table = table; *return_count = w->list.selectedItemCount; } int XmListGetTopPos(w) XmListWidget w; { /* we add one because a top_position of 0, means item 1 is on the top */ return w->list.top_position + 1; } int XmListGetBottomPos(w) XmListWidget w; { return w->list.top_position + 1 + w->list.visibleItemCount - 1; }