How to change default black screen to white in motif app? - Motif

This is a discussion on How to change default black screen to white in motif app? - Motif ; How to change default black screen to white in motif app? Hi. I have motif application. When I press left mouse button and drag it I have rectangular with black lines, but background changes periodically from white to black. How ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to change default black screen to white in motif app?

  1. How to change default black screen to white in motif app?

    How to change default black screen to white in motif app?
    Hi.
    I have motif application. When I press left mouse button and
    drag it I have rectangular with black lines, but background
    changes periodically from white to black. How to keep
    steady white background? Is it default black screen here?
    I use:
    XSetForeground(thedisp , thegc ,
    BlackPixel(thedisp , DefaultScreen(thedisp))) ;
    XSetFunction(thedisp , thegc , GXinvert) ;//GXxor gave me yellow rect
    lines
    Valeri.
    ambal007@netzero.net


  2. Re: How to change default black screen to white in motif app?


    "Valeri" wrote in message
    news:1166475757.906227.20570@f1g2000cwa.googlegrou ps.com...
    > How to change default black screen to white in motif app?
    > Hi.
    > I have motif application. When I press left mouse button and
    > drag it I have rectangular with black lines, but background
    > changes periodically from white to black. How to keep
    > steady white background? Is it default black screen here?
    > I use:
    > XSetForeground(thedisp , thegc ,
    > BlackPixel(thedisp , DefaultScreen(thedisp))) ;
    > XSetFunction(thedisp , thegc , GXinvert) ;//GXxor gave me yellow rect
    > lines
    > Valeri.
    > ambal007@netzero.net
    >


    I am not clear what it is you are actually trying to do.
    If you are trying to drag a black rectangle across a white field,
    (called "rubberbanding") you really do need to use GXxor.

    However, the color you want to use is not BlackPixel.
    You should use
    Pixel p = BlackPixel ^ w;

    where 'w' is primary color of the background over which you
    are drawing (in your case, it is WhitePixel);

    Also, you need to "remember" each draw. The next time you
    draw your rectangle in its new position, you need to first
    re-draw the former position, using GXXor. This will restore
    whatever was there before you drew the reectangle last time.

    Note that the rectangle will be black only over those portions
    of the screen that are currently white. If you cross any text,
    for example, the line that goes throught the text will be neither
    black nor white nor the text color, but some other color
    defined by pixel "Black ^ White ^ textColor".

    Ensuring that the rectangle is ALWAYS black, regardless
    of the color of things it crosses over, is much more
    difficult to do; you will have to use overlay planes.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Software Reuse Project





+ Reply to Thread