/* **********************************************************************
 * *                                                                    *
 * *   Returns a Motif list widgets current selection position          *
 * *                                                                    *
 * **********************************************************************
 * File: iris/xsig/ixmlistpos_f.c
 *
 *                        COPYRIGHT (c) 1999  BY
 *          SIGMET INCORPORATED, WESTFORD MASSACHUSETTS, U.S.A.
 * 
 * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
 * ONLY  IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
 * INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR  ANY OTHER
 * COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
 * OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
 * TRANSFERED.
 */

#include <stdio.h>
#include <Xm/List.h>
#include "sigtypes.h"
#include "xsig_lib.h"

SINT2 ixslistpos_f( Widget wgt_a )
{
  int ipcnt, *ipptrs, ipos;

  if ( XmListGetSelectedPos( wgt_a, &ipptrs, &ipcnt) == False ) 
    ipos = 0;
  else
  {
    ipos = ipptrs[0];
    XtFree((char *)ipptrs);
  }


  return ipos;
}

SINT2 ixslisttop_f( Widget wgt_a )
{
  int itop;
  XtVaGetValues( wgt_a, XmNtopItemPosition, &itop, NULL );
  return itop;
}

SINT2 ixslistcnt_f( Widget wgt_a )
{
  int icnt;
  XtVaGetValues( wgt_a, XmNitemCount, &icnt, NULL );
  return icnt;
}
