HELP! Mixed-model Colormap setting PLEASE PLEASE PLEASE

HELP! Mixed-model Colormap setting PLEASE PLEASE PLEASE

Post by Christopher L » Thu, 22 Apr 1993 06:30:16



Dear SGI and netter GL-X Mixed-Model experts,
I am writing a mixed model application that creates a couple different
color maps for different windows, and I've been having trouble getting
the window manager to reliably honor my requests.  In some environments
(entry level R3000 Indigo w/ 4.0.5) all windows are getting properly
connected to their designated color maps, but on others (an IRIS 4D 240/GTX;
also a different entry level Indigo) the color mapping is unreliable
and changes behavior when I compile at different times.  The most common
problem is that all non-top-level windows fail to be displayed according
to their colormap.  My application starts out by creating three top-level
windows; in some cases all but the first of these also fail to be
displayed by their colormap.  This is spectacularly aggravating.

I would dearly appreciate
  1. an explanation of the standard, RIGHT, CORRECT way to give a window
  a colormap such that the Window Manager will Honor and Obey it;

  2. any advice about problems that could cause my failure to get my
  desired colormaps.

By now I have exhausted my own attempts on this, having tried everything
reasonable or imaginable.

Below is example code giving the schematic for how I have been *TRYING*
to do this.  Please, please, please SOMEBODY tell me what I am doing
wrong/how to do it right!!!

Yours,

Chris Lee

/***********************************************************************/
Display* dpy;  /* DECLARE SOME DATA... */
Colormap popup_cmap;
XColor mycolor;
Window win;
XSetWindowAttributes cwa;
int nwlist;
Window *wlist;

/* NB: FOR BREVITY, NOT SHOWING ALL CODE LINES--JUST A SCHEMATIC */

popup_cmap=XCreateColormap(dpy,DefaultRootWindow(dpy),vis->visual,AllocAll);

/* HERE WE STORE A BUNCH OF COLORS USING
   XStoreColor(dpy,popup_cmap,&mycolor); ... */

cwa.colormap = popup_cmap;
win = XCreateWindow(dpy, parent, x, y, w, h,
                    borderWidth, vis->depth, InputOutput, vis->visual,
                    CWColormap|CWBorderPixel, &cwa);

/* LIST ALL SUB WINDOWS OF my_topwin, PARENT OF win, INTO wlist;
   nwlist IS COUNTER OF ENTRIES IN wlist.

   NB: wlist is static storage that can be relied on not to go away
       or be corrupted.  I thought of that!  Does anyone know if
       setting WM properties is by data copy, or by reference pointer?

       ie. is it acceptable to pass data for a Property, then free
       the data?   */
XSetWMColormapWindows(dpy,my_topwin,wlist,nwlist);

XMapRaised(Display0,win);

/* LATER ON WE HANDLE XEvents NORMALLY... TYPICAL EVENTLOOP */

 
 
 

HELP! Mixed-model Colormap setting PLEASE PLEASE PLEASE

Post by Michael T » Thu, 22 Apr 1993 09:35:37



Quote:>I would dearly appreciate
>  1. an explanation of the standard, RIGHT, CORRECT way to give a window
>  a colormap such that the Window Manager will Honor and Obey it;

>  2. any advice about problems that could cause my failure to get my
>  desired colormaps.

The correct thing is to call XSetWMColormapWindows, on your top level window,
with your colormaps sorted with most important windows appearing earlier
in the passed array.  This will instruct 4Dwm (you are running 4Dwm?)
that when that top level window has focus, its colormap should be
installed.  If you want all your windows to have colormaps installed
when any one gets focus, you can do that by putting the same list
of all windows on all your top level windows.

How many different colormaps you can have showing at a time is
a function of several different variables.  What the hardware
supports, what other stuff is on the screen, what you are doing with your
pointer.

In the code you supplied, there is some stuff about "pop-ups".
If the windows you are creating are "OverrideRedirect", then the
window manager will not bother to install colormaps for you.

In your message, you mentioned Entry Indigo and a 240 GTX, I think.

The Entry graphics can have four colormaps installed and viewable
in different windows at the same time.  However, RGB windows will
use one of those colormaps.  I would need to know more about what
your software is doing to figure out why you aren't getting the
colormaps you are expecting.

On GTX graphics, RGB windows to not use a colormap cell, but there
is only ONE (1) hardware colormap, so you can't have two different
colormaps installed at the same time.  Installing one causes the
other to be de-installed.

Hope this is helpful.

-Michael
--
 .signature:  No such file or directory

 
 
 

HELP! Mixed-model Colormap setting PLEASE PLEASE PLEASE

Post by Joel Tesl » Sat, 24 Apr 1993 01:26:20


The data in wlist does not need to be static.  It just sets a
property.  When you program is running, you can use xprop to look at
WM_COLORMAP_WINDOWS on your top level window.  You should have in your
list at least one window for each colormap you are dealing with (e.g.
one gl window one popup window, etc.)  Make sure that your top level
window comes last, so that on hardware with only one colormap your GL
window will have priority.

Joel Tesler

415-390-3048

 
 
 

1. PLEASE PLEASE PLEASE HELP ME!

I have an NT workstation with MTOR "Cilent mode"
All is ok, but when i lanch the test for Renderman, it give me the follow
error:

C:\Pixar\PHOTOR~1.1\etc\setup>make

C:\Pixar\PHOTOR~1.1\etc\setup>..\..\bin\shader -q finite.sl shield.sl

C:\Pixar\PHOTOR~1.1\etc\setup>..\..\bin\prman trial.rib
S01001 Cannot load shader "defaultsurface". (WARNING)
R10007 Cannot find default shader.
D04001 DspyName: couldn't find requested driver: ./d_tiff.dll ((null)): No
such file or directory (W
ARNING)
R90011 Can't open display image trial.tif: No such file or directory
S01001 Cannot load shader "ambientlight". (WARNING)
S01001 Cannot load shader "matte". (WARNING)
S01001 Cannot load shader "defaultsurface". (WARNING)
R10009 Cannot find default shader.
R50005 Cannot obtain license - License error: -1, Cannot find license file
The license files (or server network addresses) attempted are
listed below. Use LM_LICENSE_FILE to use a different license file,
or contact your software provider for a license file.
License path: C:\flexlm\license.dat
FLEXlm error: -1,234

C:\Pixar\PHOTOR~1.1\etc\setup>..\..\bin\cmptiff -q trial.tif check.tif
TIFFOpen Error: trial.tif: Cannot open
cmptiff: can't open "trial.tif"

C:\Pixar\PHOTOR~1.1\etc\setup>

The license is ok. All modules run ok, but renderman return me this Error.

Please please please help me.

Thank in advance

Enrico

2. More MHA News

3. PLEASE PLEASE PLEASE HELP !!!!!!!!!!!!!

4. animation filter

5. PLEASE NEED HELP WITH ALIEN BLACK BOX FILTER -- I BEG -- PLEASE PLEASE

6. Wanted: Mac OS and Mac OS X port of "Tux Paint"

7. Please,please,please help, with sugar on top

8. How to model a Thimble, any ideas?

9. EnumEnhMetaFile Help Needed! (Please Please Please)

10. PLEASE HELP HELP HELP PLEASE HELP

11. motorbike DXF please please please

12. Please Please Please