[comp.sys.sgi] defining popup menu colors

aihaug@AUSTIN.LOCKHEED.COM (Daniel A Haug) (08/03/89)

I am having problems with colors in the pop-up menu facility.  We have
a map-graphics (i.e. color map display) system that uses the normal 12
bitplanes for doing its drawing.  However, the application code that I
execute in the same window (all the same program) performs pop up calls
(e.g. defpup, dopup).  The problem is that the color of the menus that
pop up are very bizarre.  Certainly seems like this map-graphics system
is responsible.  But, it only happens on our 4D/70, not our personal
iris.  That is, the exact same program on the personal iris still generates
nice black & white menus, but the one running on the 4D/70 generates
orange and red menus.

I figured that I could override this behaviour by altering the color
map in the PUPDRAW overlay.  So, I inserted the following code in
front of the "defpup" and "dopup" calls.  The result was no effect,
until I exited the program.  Then all of the popups on the windows
(e.g. 4-sight menus) were effected by this color-map.

What is wrong here?  Don't defpup and dopup use the PUPDRAW overlay?
If so, how could one screw up the color-map so that my code would
not work?  I don't have source-code access to this map-graphics package
on which my application is running.  I don't know what it is doing.

Any help or hints are certainly appreciated.

====================== code to override colormap in PUPDRAW mode =======

set_pop_up_colors() {
  short r,g,b;
  Colorindex i;

  drawmode(PUPDRAW);
  i = 0;
  r = 0; g = 0; b = 0;
  mapcolor (i,r,g,b);
  i = 1;
  r = 255; g = 0; b = 0;
  mapcolor (i,r,g,b);
  i = 2;
  r = 0; g = 255; b = 0;
  mapcolor (i,r,g,b);
  i = 3;
  r = 0; g = 0; b = 255;
  mapcolor (i,r,g,b);

  ... perform defpup and dopup here ...

  return;
}

=========================================================================

dan haug
-- 
Internet: haug@austin.lockheed.com
UUCP:     ut-emx!lad-shrike!aihaug