A gwm widget always uses the colourmap of its parent window; if there are insufficient colourmap entries left (less than minColours) the creation of the widget will fail. In these circumstances, a gwm widget can still be created by creating a frame or top level widget with a new colourmap (with the -colormap new option) and using this as the parent of the gwm widget2.
In the case of a frame with a new colourmap it is also necessary to inform the window manager so that the correct colourmap is installed when the frame receives the input focus with:
wm colormapwindows [winfo toplevel $w] $wwhere w has been set to the name of the new frame widget.
The same technique can be used to create a gwm widget with a visual type other than the default for the screen being used.
STARTCL --- Starlink Extensions to Tcl & Tk