Danny Backx wrote:
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?

Probably an Endian issue. Difficult to tell more without knowing (1) output of xdpyinfo (2) how you defined BLUE_PIXEL and YELLOW_PIXEL



------------------------------------------------------------------------

#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);
}


--
Michel Bardiaux
Peaktime Belgium S.A.  Bd. du Souverain, 191  B-1160 Bruxelles
Tel : +32 2 790.29.41


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Lesstif-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lesstif-discuss

Reply via email to