finnm@clas01.cebaf.gov (Michael Finn) (05/29/91)
Hi, We are trying to add into some software that we are writing a selection menu which will allow us to change things like the background and foreground colors at the touch of a button. Currently our color selection menu will pull up a sub-window displaying all 256 color choices in their own buttons. Our program creates a "rainbow" Colormap from the 21st color to the 255th color. What our underlying problem is involves trying to pass the colormap to this (and other) sub-windows. Our subwindows will come up fine, but with the default colormap of the root (display) window. (In other words our child windows are using the default colormap and we want them to use our colormap defined as cmap.) Any help would be apprecitated. We have tried setting the colormap on creation of this window through XtNcolormap, and have tried several other combinations. The following is how we are defining the Bulletin Board Widget for this window: Widget CreateBB(parent, name, dialogstyle) Widget parent; String name; unsigned char dialogstyle; { #define MAX_ARGS 20 Widget w; int n; Arg args[MAX_ARGS]; n = 0; XtSetArg(args[n], XmNdialogTitle, XmStringCreate(name, CHARSET)); n++; XtSetArg(args[n], XmNdialogStyle, dialogstyle); n++; XtSetArg(args[n], XmNautoUnmanage, False); n++; XtSetArg(args[n], XmNcolormap, cmap); n++; w = XmCreateBulletinBoardDialog (parent, name, args, n); return(w); } this routine is called by: { Widget color_edit_dlog; ... color_edit_dlog = CreateBB(toplevel, "color edit", XmDIALOG_MODELESS); ... } We are using X11R3.5 and Motif 1.0 on a DECstation 5000/200 with an 8 plane monitor. Please E-mail me with ANY suggestions at finnm@clas01.cebaf.gov -- ######################################################################### Mike Finn finnm@clas01.cebaf.gov DISCLAIMER: My words do not replect those of my employers or anyone else who knows me.