@begin(header)
author: ackerman=ag@.ics.uci.edu
show_author: ShowNone
author_organization: Harvard X Class
node_expert: ackerman=ag@ics.uci.edu 
expiration_date: 11/25/93
last_modifier: ackerman=ag@.ics.uci.edu
last_mod_date: 11/25/91
mod_num: 1
@end(header)
@begin(Q)
Can I have strings with different fonts in a list?
@end(Q)

@begin(A)
Yes. The strings are XmStrings. Each one can be created using a
different character set using a different font.
				
				Motif FAQ 8/12/91
@end(A)

@begin(Q)
How do I best put a new set of items into a list?
@end(Q)

@begin(A)
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);

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.
				
				Motif FAQ 8/12/91

@end(A)

@begin(Q)
Can I get a bitmap to show in a list item like I can in a Label?  I
want to place a bitmap along with some normal text in my list items.
@end(Q)

@begin(A)
No. The list contains XmStrings, and these only allow text in various
character sets. The workaround is to define your font containing the
icons you want. Then you can create a fontlist containing your icon
font and the font you want the text in, and then make your items
multi-segment XmStrings where the first segment contains the code of
the icon you want with a charset that matches the icon font in your
fontlist and the second segment with a charset matching the text font.
				
				Motif FAQ 8/12/91

@end(A)

@begin(Q)
Can I have items with different colours in a list?
@end(Q)

@begin(A)
No.  The list contains XmStrings, and these only allow text in various
character sets. Since the items are XmStrings, you can already change
the font of an item by replacing it with an item with the same text
and a different charset tag.  Adding support for color would require
modification of the internal data structure in XmList as well as
modification to the drawing routines.  A possible workaround is to use
a rowcolumn of buttons which can be individually set.  However, you
would have to do all list functionality yourself.
				
				Motif FAQ 8/12/91

@end(A)

@begin(Q)
Can I grey out an item in a list?  I want to make insensitive items in
a list so that they cannot be selected.
@end(Q)

@begin(A)
From W. Scott Meeks of OSF:

Unfortunately, you can't do it directly since the list items aren't
individual widgets.  We've had other requests for this technology, but
it didn't make the cut for 1.2; it should be in some future release.

However, you can probably fake it in your application with some
difficulty.  First, a list item is an XmString, so you can specify a
different charset for the item than for other items in the list and
then specify a font in the list's fontlist that matches the charset
and gives you the visual you want.  The next problem is making the
item unselectable.  One idea would be to have the application keep
track of the insensitive items and the items currently selected.  Then
you would set up a selection callback that when called would check the
item selected against the list of insensitive items and if the
selected item matched would deselect that item and reselect the
previously selected items.  Otherwise it would just update the
application's list of selected items.  The major drawback with this
approach is that you'll get flashing whenever the list selects an item
and your application immediately de- selects.  Unfortunately I can't
think of a way around this without mucking with the list internals.

Another alternative suggested is to use instead a column of say read
only text widgets which you can make insensitive.
					
				Motif FAQ 8/12/91

@end(A)

