Here are some tips about writing applications for the CDE desktop.
To ensure that your application works properly on the CDE desktop, any functionality you put into floating menus should also be provided by some pulldown menu. This will enable your application to work with both two-button and three-button mouse devices.
Colormap installation is handled differently under CDE than it was in the OpenWindows environment. This difference is most visible for applications that specify a list of subwindows that use colormaps other than the default colormap. This list of subwindows is specified in the WM_COLORMAP_WINDOWS property.
In the OpenWindows environment, applications need only to specify a list of subwindows in this property. As the user moves the pointer around the screen, the OpenWindows window manager (olwm) installs the appropriate colormap for whatever window is under the pointer.
The CDE window manager, dtwm, does not provide this behavior. Applications that relied on olwm's pointer-based colormap installation will likely not display in their proper colors when run under CDE. There are several things that you can do to avoid this problem:
Avoid using the WM_COLORMAP_WINDOWS property entirely, and update the colormap attribute of the top-level window (the window of the shell widget) with whatever colormap is appropriate. This colormap will be installed whenever the window is given the input focus.
The WM_COLORMAP_WINDOWS property is an ordered list of windows, and typically only the first window in this list will have its colormap installed and will appear in its proper colors. The other subwindows will most likely appear with incorrect colors. If it is important for a particular subwindow to appear with its correct colors, it should be placed first in the list.
If the ID of the top-level window does not appear in the list, it is implicitly assumed to appear first. To get a subwindow to display with its correct colors, the ID of the top-level window should appear in the list somewhere after the ID of the subwindow.
Applications can update the WM_COLORMAP_WINDOWS property at any time. If the application's state changes such that a different subwindow should now have its colormap installed, the application should update the property so that the new subwindow appears first.
The user can also modify the key bindings of dtwm to bind the f.next_cmap() and f.prev_cmap() functions to keyboard keys. These functions will step forward and backward through the WM_COLORMAP_WINDOWS list and install a different colormap each time the user presses the appropriate keys.