|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 2047 (0x7ff) Types: TextFile Notes: R1k Text-file segment
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦74f95ec06⟧ └─⟦this⟧
/*================================================================= ; IRP MULHOUSE AVRIL 92 ;------------------------------------------------------------------- ; PROJECT : Z80 SIMULATOR ; STUDENTS : MOREAUX & VERGER ; ; FILE : XmListExtension.c ================================================================== ; DESCRIPTION : ; Definition de la fonction "Boolean XmListGetSelectedPos ()" non ; presente dans la version XFM intallee . ;----------------------------------------------------------------*/ #include <X11/Intrinsic.h> #include <X11/IntrinsicP.h> #include <Xm/XmP.h> #include <Xm/Xm.h> #include <Xm/List.h> #include <Xm/ListP.h> #include "XmListExtension.h" /************************************************************************ * * * XmListGetSelectedPositions - returns the positions of the selected * * items in the list. CALLER MUST FREE SPACE! * * * ************************************************************************/ Boolean XmListGetSelectedPos (Widget w, int **pos_list, int *pos_count) { XmListWidget lw = (XmListWidget) w; register int i, *pos; int j; register int selectedCount=0; if ((lw->list.items == NULL) || (lw->list.itemCount <= 0) || (lw->list.selectedItemCount <= 0)) return(FALSE); /* ** lw->list.selectedItemCount may not give the real number of selected ** items; run through list and precalculate number of selected items. */ for (i = 0; i < lw->list.itemCount; i++) if (lw->list.InternalList[i]->selected) selectedCount++; if (0 == selectedCount) return (FALSE); pos = (int *)XtMalloc((sizeof(int) * selectedCount)); j = 0; for (i = 0; i < lw->list.itemCount; i++) if (lw->list.InternalList[i]->selected) pos[j++] = (i+1); *pos_list = pos; *pos_count = j; return(TRUE); } /*----- End --------------------------------------------------------------*/