[ By Archive-name | By Author | By Category | By Newsgroup ]
[ Home | Latest Updates | Archive Stats | Search | Usenet References | Help ]

    Search the FAQ Archives

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page

Top Document: Motif FAQ (Part 5 of 9)
Previous Document: 109) Should I create an XmList widget as a child of automatic
Next Document: 111) Can I have strings with different fonts in a list?


110) How do I best put a new set of items into a list?



Answer: Set the new list count and list by XtSetArgs and install them by
XtSetValues.

XmString list[SIZE];
int list_size;

XtSetArg (args[n], XmNitemCount, list_size); n++;
XtSetArg (args[n], XmNitems, list); n++;
XtSetValues (w, args, n);


or similarly with XtVaSetValues:


XtVaSetValues (w,
    XmNitemCount, list_size,
    XmNitems, list,
    NULL);


Each time the list is reset by this the old contents are freed by the widget
and the new supplied list is copied.  Do *not* free the old list of items
yourself as this would result in the space being freed twice.  It is not
necessary to remove the items one at a time, nor to "zero" out the list first.



Top Document: Motif FAQ (Part 5 of 9)
Previous Document: 109) Should I create an XmList widget as a child of automatic
Next Document: 111) Can I have strings with different fonts in a list?

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page


[ By Archive-name | By Author | By Category | By Newsgroup ]
[ Home | Latest Updates | Archive Stats | Search | Usenet References | Help ]


Send corrections/additions to the FAQ Maintainer:
kenton@rahul.net (Ken Lee)

Last Update July 06 2008 @ 00:13 AM

© 2008 FAQS.ORG. All rights reserved.