Parent document is top of "Motif FAQ (Part 5 of 9)"
Previous document is "158) Why doesn't the XmLabel widget obey the XmNwith and XmNheight"
159) How do you set the background color of a label widget using
XtVaTypedArg?
[Last modified: July 96]
Answer: Use the XmNbackground resource to control the background color, e.g.
strcpy(bgcolor, "yellow");
XtVaSetValues(widget,
XtVaTypedArg, XmNbackground, XtRString, bgcolor,
strlen(bgcolor)+1, NULL);
The length of the color string is plus one to include the null character.
XtRString is the type to be converted. The conversion is required because
XmNbackground expects a Pixel type.
Thanks to Martin Squicciarini (msquicci@resd.vf.ge.com).
-----------------------------------------------------------------------------
END OF PART FIVE
Parent document is top of "Motif FAQ (Part 5 of 9)"
Previous document is "158) Why doesn't the XmLabel widget obey the XmNwith and XmNheight"