Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!elroy.jpl.nasa.gov!decwrl!adobe!asente From: asente@adobe.com (Paul Asente) Newsgroups: comp.windows.x Subject: Re: XtSetArg for Setting colour to widget? Message-ID: <7907@adobe.UUCP> Date: 2 Nov 90 07:18:16 GMT References: <7246.27309166@swift.cs.tcd.ie> Sender: news@adobe.COM Organization: Adobe Systems Inc. Lines: 18 In article <7246.27309166@swift.cs.tcd.ie> gteo@swift.cs.tcd.ie writes: >When I try to set the background or foreground colour for >a widget, for example, a label using the following, > > XtSetArg(arg[i],XtNbackground, "blue"); i++; > ... > XtSetValues(label, arg,i); The XtNbackground resource takes a Pixel value, not a string. Either invoke a type converter to convert the string to a pixel value (i.e. XtConvertAndStore in R4, XtConvert in R3) or use the new varargs interface XtVaSetValues and use an XtVaTypedArg. My recently-published book has an extensive section on this. I recommend it highly :-). -paul asente asente@adobe.com ...decwrl!adobe!asente