Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!csus.edu!ucdavis!csusac!unify!openlook!openlook-request From: Amy.Moore@Corp.Sun.COM (Amy) Newsgroups: comp.windows.open-look Subject: Re: Open Look Scrolling List help!!! Message-ID: Date: 3 May 91 01:33:34 GMT Lines: 58 >> >>Is there an easy way (or any way at all) to specify fonts for the individual >>elements in a Open Look Scrolling List widget? Can you set background colors >>for the individual elements? I'm writing an application that I need to >>have certain elements in a scrolling list highlighted in some way. Is this >>possible? >> Someone has probably already answered this, but what the heck... Unfortunately, in OLIT, you cannot set individual fonts or background colors for ListItem strings(good "Request for Enhancement" though!). (though you *May* be able to use the glyph to get some color accent) If you look at the structure for the ListItems: /* From ScrollingL.h...*/ typedef struct _OlListItem { /* OPEN LOOK list item */ OlDefine label_type; XtPointer label; XImage * glyph; OlBitMask attr; XtPointer user_data; unsigned char mnemonic; } OlListItem; This shows what attributes you can set on individual ListItems. You can set an item to look 'selected' using the attr field (and you can have multiple, disjoint items selected at once - in 3D they will looked depressed). Below is a code fragment which shows how to set this.... (You probably should consult the docs to better understand all the code - it is sort of obscure). OlListToken token; OlListItem *item = OlListItemPointer(token); void (*ListTouchItem)(); /* Get handle of update routine...*/ XtVaGetValues(scrollinglist, XtNapplTouchItem, (XtArgVal)&ListTouchItem, NULL); /* * Mark the item as selected or current by setting a bit * in its attribute field. Notify the widget that we have * touched an item. */ item->attr |= OL_LIST_ATTR_CURRENT; /* set current attr */ (*ListTouchItem)(scrollinglist, token); /* tell list */ Hope this helps somewhat. Regards, Amy Moore aim@sun.com