Using non-default visuals/colormaps

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

Submitted by Anonymous on Fri, 10/03/2003 - 21:37.

Hello, I am currently working on porting several X/Motif applications from X11R5 Motif 1.2 running on HP-UX 10.20 workstations to X11R6 OpenMotif 2.2 running on HP/Compaq PC workstations with Red Hat Linux 9.0. One of these applications uses cyclic colormap modification to cause symbols within an
XmDrawingArea to blink. The default visual on the old HP workstations was Psuedocolor with a depth of 8. Since the Psuedocolor visual supports read/write colormaps, we were able to use XAllocColorCells to create a few writable color cells to support our blink functionality. On Linux, the default visual is TrueColor, which provides a read-only colormap. The only other visual supported on Linux is DirectColor, which does provide a writable colormap. So, I changed the default visual to DirectColor and that solved the problem with my application (blinking works fine), but other Linux applications,
namely Gnome related apps, show strange coloring. After a little research, I found that Gnome applications prefer the TrueColor visual. So, then I looked into using a non-default visual (DirectColor) for my application and set the default visual back to TrueColor. This is where I have some questions. First off, I do understand that I have to use a call like XGetVisualInfo to get the DirectColor visual info and then create a colormap, using XCreateColormap, using the DirectColor visual. Then I need to use a call like XtVaSetValues to set the values of visual, colormap, and depth
for my toplevel widget before it is realized. When I create the colormap, do I need to load color values into it, just like the Xserver does when it creates the default colormap? Also, I am concerned about color flashing. On our Linux workstations, only one hardware colormap is supported. So, if I use a non-default visual and create a private colormap what would be the risk of getting color flashing as focus moves from window to window? Also, would it make sense to create a custom standard colormap so that I would only have to create it once, and it could be reused until the workstation is rebooted? Finally, do I have any other options as far as implementing the blink effect that we desire on these new workstations?

Thanks,

Tony Rossomano

Thu, 07/26/2012 - 10:31
#1
3 posts / 0 new
Last post
20
Thu, 07/26/2012 - 10:31
-33
Thu, 07/26/2012 - 10:31