It doesn't, your application is probably wrong. Here is a complete example that works for me.
Danny
On Tue, 2005-06-21 at 00:01 +0000, w.szukalski wrote:
> the bg_pixel e.g. is BLUE_PIXEL and the fg_pixel e.g. is
> YELLOW_PIXEL, then openmotif shows a yellow text on a
> blue background; lesstif shows a black text on a blue
> background.
>
> Why does lesstif refuse the foreground color?
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
#include <Xm/Xm.h>
#include <Xm/PushB.h>
#include <stdio.h>
static char *FallBack[] = {
"*.geometrySlop: 1",
"*red: red",
"*blue: blue",
NULL
};
typedef struct appres {
Pixel red;
Pixel blue;
} *appresp, appres;
appres Appres;
XtResource res[] = {
{ "red", "Red", XmRPixel, sizeof(Pixel), XtOffset(appresp, red),
XmRImmediate, (XtPointer)1},
{ "blue", "Blue", XmRPixel, sizeof(Pixel), XtOffset(appresp, blue),
XmRImmediate, (XtPointer)2}
};
int
main(int argc, char **argv)
{
Widget toplevel, one;
XtAppContext app;
XmString xmstr1 = XmStringCreateLtoR("Here Is A\nLabel", "MY_FONT");
XtSetLanguageProc(NULL, NULL, NULL);
toplevel = XtVaAppInitialize(&app, "Label", NULL, 0, &argc, argv, FallBack, NULL);
XtGetApplicationResources(toplevel, &Appres, res, XtNumber(res), NULL, 0);
fprintf(stderr, "Red is %08p, blue is %08p\n", Appres.red, Appres.blue);
one = XtVaCreateManagedWidget("One", xmPushButtonWidgetClass, toplevel,
XmNlabelString, xmstr1,
XtNborderWidth, 20,
XmNforeground, Appres.red,
XmNbackground, Appres.blue,
NULL);
XtRealizeWidget(toplevel);
XtAppMainLoop(app);
exit(0);
}
signature.asc
Description: This is a digitally signed message part

