[comp.windows.x.motif] Accessing internal structure of List

ems@socrates.JPL.NASA.gov (Eric Slimko) (10/05/90)

I am writing a routine that does (supposedly) some
work with the internal structure of a List Widget.
Unfortunately, I am having problems with accessing parts
of the structure-- some turn up 0 while others are fine.
Here's a small example of the routine that's giving me problems:

#include <X11/Intrinsic.h>
#include <X11/IntrinsicP.h>
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Xm/List.h>
#include <Xm/ListP.h>

void ListInfo(w)
XmListWidget(w)
{
   printf("Last Hightlighted Item:%d", w->list.LastHLItem);
}

(Yup, I do have a item highlighted before this is called)

This kind of thing works with some of the values, like StartItem
and visibleItemCount, but fails for others, like LastHLItem
and itemCount.  Mostly, I get 0, but sometimes I turn up with a random
number like 163384, which leads me to believe I am not accessing the
correct structure...I have written Widgets before, and this is
how I accessed them in their private routines, so I don't see what
gives.

Please Help!

Thanks in advance,
-- 
Eric Slimko               |  Jet Propulsion Laboratories
ems@socrates.jpl.nasa.gov |  NASA/CalTech