Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jarthur!uunet!cme!cam!straw From: straw@cam.nist.gov (Mike Strawbridge) Newsgroups: comp.windows.x Subject: Re: XView scrolling list usage Message-ID: <5873@pizza.cam.nist.gov> Date: 20 Nov 90 15:12:54 GMT References: <9011200021.AA02255@zia.aoc.nrao.edu> Reply-To: straw@pizza.UUCP (Mike Strawbridge) Organization: National Institute of Standards & Technology, Gaithersburg, MD Lines: 49 Thanks for your reply to my article. But maybe I was not clear enough on my first question. >> I would like to change the all the list's string items by passing to xv_set >> one attribute/value pair with a value argument such as a pointer to an array >> of pointers to char. Can I do this or do I have to know how many items are >> in the list and pass each string in a separate argument? > >The PANEL_LIST_STRINGS attribute does exactly what you want. Used with >xv_create or xv_set it takes a NULL terminated list of strings in an array >of char* and sets each item in the scrolling list to the corresponding >entry in the array, discarding any previous contents (see pages 155ff in >the XView programmers manual). I would like to change the contents of the list with one call to xv_set(). And since my lists will have differing number of items, I was looking for a way to do this without knowing at compile time how many items are in the list. For example, something like char *strings[] = { "string1", "string2", "string3", NULL }; xv_set(panel, PANEL_LIST_STRINGS, strings, NULL); instead of xv_set(panel, PANEL_LIST_STRINGS, "string1", "string2", "string3", NULL, NULL); With the first form, changing the strings in a dynamic scrolling list is much easier. With the second form I have to know at compile time how many items are in the list. Is something like the first form possible? Alternatively if the second form is all that is available, I could put an xv_set(panel, PANEL_LIST_STRING, ...) into a loop and set each string individually, but I see this as uncool. It takes a little longer and the display is updated for each xv_set() causing it to blink wildly. mike ----------------------------------------------------------------------- NAME: Michael Strawbridge TELE: (301) 975-3852 USMAIL: National Institute of Standards ARPA: straw@cam.nist.gov and Technology UUCP: uunet!cme-durer!straw Rm. B-146, Bldg. 225 Gaithersburg, MD 20899