[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
    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: 154) Why doesn't the XmLabel widget obey the XmNwith and XmNheight


155) 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



Top Document: Motif FAQ (Part 5 of 9)
Previous Document: 154) Why doesn't the XmLabel widget obey the XmNwith and XmNheight

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


[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]

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

Last Update August 29 2008 @ 00:13 AM

© 2008 FAQS.ORG. All rights reserved.