[comp.sys.sun] Colours in Menus

mesard@wilma.bbn.com (12/15/88)

everson%COMPSCI.BRISTOL.AC.UK@rice.edu writes:
>Does anyone know a way of forcing the menu system in SunView to use your
>own defined colourmap...?

SunView uses the 0th and 255th slots in the Root window's colormap as the
background and foreground for menus.  It insists on setting them to the
foreground and background colors that were in effect when you started
Suntools.  So if you're using a 256 color CMS, it has to step on your
first and last colors, to place the menu's colors into the colormap.  So
the short answer is, don't use the first or last color of your map.

That should prevent the "flash".  If your question really was about how to
specify the colors for menus from within a program, then I would say "I
don't know," and probably, "You can't."  The fg and bg colors get reset
somewhere between the time you call menu_show() and the time the menu is
displayed.  If it's before the menu_gen_proc() is called, then you might
be able to access the root window's colormap from within the
menu_gen_proc() and undo the "reset."  But I doubt it is, and I doubt you
can.