CanvasInit()
{
    DBG_IN("CanvasInit") ;

    Gcvs.wid.win   = XtWindow (Gcvs.wid.id) ;

    /* Get necessary data from the widget internals */


    RESET_NUM_ARGS ;
    GET_WID_ARG(XmNcolormap,   &Gcvs.wid.cmap) ;
    GET_WID_ARG(XmNforeground, &Gcvs.pixel.fg) ;
    GET_WID_ARG(XmNbackground, &Gcvs.pixel.bg) ;

    GET_WID_VALUES(Gcvs.wid.id) ;

    /* Get related shadow colors */
    {
        Pixel nu_fg, nu_select, nu_top;

        /* Get background_shadow */
        XmGetColors(XtScreen(Gcvs.wid.id), Gcvs.wid.cmap, 
			Gcvs.pixel.bg,
                            &nu_fg, &nu_top,
                                &Gcvs.pixel.sh_bg, &nu_select) ;

        /* Get foregrournd shadow */
        XmGetColors(XtScreen(Gcvs.wid.id), Gcvs.wid.cmap,
			Gcvs.pixel.fg,
                            &nu_fg, &nu_top,
                                &Gcvs.pixel.sh_fg, &nu_select) ;
    }


    Gcvs.pixmap.bg      = (Pixmap)NULL ;
    Gcvs.pixmap.bg_stip = (Pixmap)NULL ;

    Gcvs.gc.fg		= NULL ;
    Gcvs.gc.shadow	= NULL ;

    CanvasInitDimensions() ;
    CreateCanvasGCs() ;
    CreateCanvasPixmaps() ;

    DBG_OUT("CanvasInit") ;
    return(DT_OK) ;
}
Esempio n. 2
0
// Convert String to Pixmap (using XmGetPixmap)
// A Pixmap will be read in as bitmap file
// 1 and 0 values are set according to the widget's 
// foreground/background colors.
static Boolean CvtStringToPixmap(Display *display, 
				 XrmValue *args, Cardinal *num_args, 
				 XrmValue *fromVal, XrmValue *toVal,
				 XtPointer *)
{
    // Default parameters
    Screen *screen   = DefaultScreenOfDisplay(display);
    Pixel background = WhitePixelOfScreen(screen);
    Pixel foreground = BlackPixelOfScreen(screen);

    if (*num_args >= 1)
    {
	// convert first arg into widget
	Widget w = *(Widget *) args[0].addr;
	background = w->core.background_pixel;
	
	screen = XtScreen(w);
	
	if (XtIsWidget(w) && XmIsPrimitive(w))
	{
	    // Get foreground color from widget
	    foreground = XmPrimitiveWidget(w)->primitive.foreground;
	}
	else
	{
	    // Ask Motif for a default foreground color
	    Pixel newfg, newtop, newbot, newselect;
	    XmGetColors(screen, w->core.colormap, background,
			&newfg, &newtop, &newbot, &newselect);
	    foreground = newfg;
	}
    }

    // Get pixmap
    Pixmap p = XmUNSPECIFIED_PIXMAP;

    string value = str(fromVal, false);

    // Some Motif versions use `unspecified_pixmap' and `unspecified pixmap'
    // as values for XmUNSPECIFIED_PIXMAP.  Check for this.
    string v = downcase(value);
    v.gsub(" ", "_");
    if (v.contains("xm", 0))
	v = v.after("xm");
    if (v != "unspecified_pixmap")
    {
	p = XmGetPixmap(screen, XMST(value.chars()), foreground, background);

	if (p == XmUNSPECIFIED_PIXMAP)
	{
	    XtDisplayStringConversionWarning(display, fromVal->addr, 
					     XmRPixmap);
	    return False;
	}
    }

    done(Pixmap, p);
}
Esempio n. 3
0
static void
get_icons(
	Widget w)
{
  Arg args[2];
  Pixel background, foreground, top_shadow, bottom_shadow, select;
  Colormap colormap;

  unsigned int width1, width2, height, dummy;

  /* get foreground and background colors */
  XtSetArg (args[0], XmNbackground, &background);
  XtSetArg (args[1], XmNcolormap,  &colormap);
  XtGetValues (w, args, 2);
  XmGetColors ( XtScreen(w) , colormap, background,
	       &foreground, &top_shadow, &bottom_shadow, &select);

  /* get "working" pixmap */
  pxWorking = XmGetPixmapByDepth(XtScreen(w), "xm_working",
                                 foreground, background, w->core.depth);
  if (pxWorking == XmUNSPECIFIED_PIXMAP)
    pxWorking = XmGetPixmapByDepth(XtScreen(w), "default_xm_working",
                                   foreground, background, w->core.depth);

  /* get "stopped/done" pixmap */
  pxStopped = XmGetPixmapByDepth(XtScreen(w), "xm_information",
                                 foreground, background, w->core.depth);
  if (pxStopped == XmUNSPECIFIED_PIXMAP)
    pxStopped = XmGetPixmapByDepth(XtScreen(w), "default_xm_information",
                                   foreground, background, w->core.depth);

  /* get the width of the two pixmaps */
  XGetGeometry(XtDisplay(w), pxWorking,
               (Window *) &dummy,               /* returned root window */
               (int *) &dummy, (int *) &dummy,  /* x, y of pixmap */
               &width1, &height,                /* pixmap width, height */
               &dummy, &dummy);                 /* border width, depth */
  XGetGeometry(XtDisplay(w), pxStopped,
               (Window *) &dummy,               /* returned root window */
               (int *) &dummy, (int *) &dummy,  /* x, y of pixmap */
               &width2, &height,                /* pixmap width, height */
               &dummy, &dummy);                 /* border width, depth */

  /* Compute margins necessary to make the labels the same width */
  if (width1 > width2)
  {
    pxWorkingMargin = 0;
    pxStoppedMargin = width1 - width2;
  }
  else
  {
    pxWorkingMargin = width2 - width1;
    pxStoppedMargin = 0;
  }
}
Esempio n. 4
0
void draw3DPane(UpdateTask *pt, Pixel bgc) {

  Pixel   tsc, bsc, fgc, slc;
  DisplayInfo *displayInfo = pt->displayInfo;
  Display *display = XtDisplay(displayInfo->drawingArea);
  GC      gc        = displayInfo->gc;
  Drawable drawable = XtWindow(displayInfo->drawingArea);
  int x = pt->rectangle.x;
  int y = pt->rectangle.y;
  int w = pt->rectangle.width;
  int h = pt->rectangle.height;

  XPoint  points[7];
  int n;
  int shadowThickness = 2;

#if 0
  XtVaGetValues(displayInfo->drawingArea,XmNshadowThickness,&shadowThickness,NULL);
#endif

  XmGetColors(XtScreen(displayInfo->drawingArea),cmap,bgc,&fgc,&tsc,&bsc,&slc);
  /* create the top shadow */
  n = 0;
  points[n].x = x;                       points[n].y = y;                       n++;
  points[n].x = x + w;                   points[n].y = y;                       n++;
  points[n].x = x + w - shadowThickness; points[n].y = y + shadowThickness;     n++;
  points[n].x = x + shadowThickness;     points[n].y = y + shadowThickness;     n++;
  points[n].x = x + shadowThickness;     points[n].y = y + h - shadowThickness; n++;
  points[n].x = x;                       points[n].y = y + h;                   n++;
  points[n].x = x;                       points[n].y = y;                       n++;
  XSetForeground(display,gc,tsc);
  XFillPolygon(display, drawable, gc, points, XtNumber(points),Nonconvex,CoordModeOrigin); 
  /* create the background pane */
  XSetForeground(display,gc,bgc);
  XFillRectangle(display, drawable, gc,
                          x+shadowThickness,y+shadowThickness,
                          w-2*shadowThickness,h-2*shadowThickness);
  /* create the bottom shadow */
  n = 0;
  points[n].x = x + shadowThickness;     points[n].y = y + h - shadowThickness; n++;
  points[n].x = x + w - shadowThickness; points[n].y = y + h - shadowThickness; n++;
  points[n].x = x + w - shadowThickness; points[n].y = y + shadowThickness;     n++;
  points[n].x = x + w;                   points[n].y = y;          n++;
  points[n].x = x + w;                   points[n].y = y + h;      n++;
  points[n].x = x;                       points[n].y = y + h;      n++;
  points[n].x = x + shadowThickness;     points[n].y = y + h - shadowThickness; n++;
  XSetForeground(display,gc,bsc);
  XFillPolygon(display, drawable, gc, points, XtNumber(points),Nonconvex,CoordModeOrigin); 
}
Esempio n. 5
0
static void default_colors()
{
     Arg args[5];
     Pixel background, foreground, top_shadow, bottom_shadow, arm_color;
     Pixel r_foreground, r_top_shadow, r_bottom_shadow, r_arm_color;
     Widget widget;
     int n = 0;
     XColor color;

     widget = XtNameToWidget(fetched,"color_change_BB.color_change");
     XtSetArg(args[n], XmNbackground, &background);		n++;
     XtGetValues(widget, args, n);

     XmGetColors(XtScreen(widget), cmap, background, &r_foreground,
			     &r_top_shadow, &r_bottom_shadow, &r_arm_color);

     XtSetArg(args[n], XmNforeground, &foreground); 		n++; 
     XtSetArg(args[n], XmNtopShadowColor, &top_shadow);		n++;
     XtSetArg(args[n], XmNbottomShadowColor, &bottom_shadow);	n++;
     XtSetArg(args[n], XmNarmColor, &arm_color);		n++;
     XtGetValues(widget, args, n);

     color.pixel = r_foreground;
     XQueryColor(dpy,cmap,&color);
     color.pixel = foreground;
     XStoreColor(dpy, cmap, &color);

     color.pixel = background;
     XQueryColor(dpy,cmap,&color);
     color.pixel = background;
     XStoreColor(dpy, cmap, &color);

     color.pixel = r_top_shadow;
     XQueryColor(dpy,cmap,&color);
     color.pixel = top_shadow;
     XStoreColor(dpy, cmap, &color);

     color.pixel = r_bottom_shadow;
     XQueryColor(dpy,cmap,&color);
     color.pixel = bottom_shadow;
     XStoreColor(dpy, cmap, &color);

     color.pixel = r_arm_color;
     XQueryColor(dpy,cmap,&color);
     color.pixel = arm_color;
     XStoreColor(dpy, cmap, &color);
}
Esempio n. 6
0
/*----------------------------------------------------------------------------
  XbrGfxShadow()
  Get the shadow colours and set them for the given widget.
  
  Widget w	The widget to wreck
  ----------------------------------------------------------------------------*/
void XbrGfxShadow(Widget w)
{
    Pixel background, top_shadow, bottom_shadow;
    Screen *screen = XtScreen(w);
    
    /* Get the background pixel of the widget. */
    XtVaGetValues(w, XmNbackground, &background, NULL);

    /* Generate the shadow colours */
    XmGetColors(screen, DefaultColormapOfScreen(screen), background, NULL,
		&top_shadow, &bottom_shadow, NULL);
    
    /* Set shadow values. */
    XtVaSetValues(w, XmNshadowThickness, 2,
		     XmNtopShadowColor,  top_shadow,
		     XmNbottomShadowColor, bottom_shadow,
		     NULL);
}
Esempio n. 7
0
void draw3DQuestionMark2(
  Display *display,
  GC      gc,
  Pixmap  pixmap,
  Widget widget,
  int x,
  int y,
  int w,
  int h,
  Pixel background)
{
  Drawable drawable = XtWindow(widget);
  Pixel   tsc, bsc, bgc, fgc, slc;
  Dimension qmh, qmw, qmlw;  /*  qmh = height of the drawing area for the question mark
				*  qmw = width of the drawing area for the question mark
				*  qmlw = line width of the question mark
				*/
  int ax, ay;                  
  unsigned int aw, ah;
  int lx1, lx2, ly1, ly2;
  int dx, dy;
  unsigned int dw, dh;
  char dotted[] = { 1, 1 };

  bgc = background;
  XmGetColors(XtScreen(widget),cmap,bgc,&fgc,&tsc,&bsc,&slc);

  qmlw = (h > w) ? (w / 10) : (h / 10);  /* calculate the line width */

  if (qmlw != (qmlw/2*2)) qmlw = qmlw + 1;  /* if odd, make it even */

  qmh = h - qmlw * 4;

  if (qmh != (qmh/2*2)) qmh = qmh + 1;      /* if odd, make it even */

  qmw = w - qmlw * 4;

  if (qmw != (qmw/2*2)) qmw = qmw + 1;      /* if odd, make it even */

  if (qmh < qmw) {
    qmw = qmh;
  }

  /* calculate the size of the top arc of the question mark */
  ax = x + w / 2 - qmw / 2;
  ay = y + qmlw * 2;
  ah = qmh / 2;
  aw = qmw;

  /* calculate the size and position of the middle stroke */
  lx1 = x + w / 2;
  ly1 = y + h/ 2 - qmlw/2;
  lx2 = lx1;
  ly2 = ly1 + qmh / 4;
  if (lx1 > lx2) lx2 = lx1;
  if (ly1 > ly2) ly2 = ly1;

  /* calculate the size and position of the bottom circle */
  dx = lx1 - qmw / 8;
  dy = ly2 + qmlw; 
  dw = qmw / 4;
  dh = qmh / 4;
  if (dw <= 0) dw = 1;
  if (dh <= 0) dh = 1;

  /* draw the foreground of the question mark 
   */
  XSetForeground(display, gc, bgc);
  XSetLineAttributes(display,gc, qmlw,LineSolid,CapButt,JoinMiter);

  /* draw mirror image 
   */
  XDrawArc(display,drawable,gc, ax,ay,aw,ah,180*64,-270*64);
  XDrawLine(display,drawable, gc, lx1, ly1, lx2, ly2);
  XFillArc(display, drawable, gc, dx,dy,dw,dh,0,360*64);


  XDrawArc(display, pixmap,gc, ax,ay,aw,ah,180*64,-270*64);
  XDrawLine(display,pixmap, gc, lx1, ly1, lx2, ly2);
  XFillArc(display, pixmap, gc, dx,dy,dw,dh,0,360*64);

  /* draw the top shadow 
   */
  XSetDashes(display, gc, 0, dotted, 2);
  XSetForeground(display, gc, tsc);
  XSetLineAttributes(display,gc, qmlw/5,LineSolid,CapButt,JoinMiter);
  
  /*  XSetLineAttributes(display,gc, qmlw/5,LineOnOffDash,
   * CapButt,JoinMiter,FillSolid); 
   */

  /* draw mirror image 
   */
  XDrawArc(display,drawable,gc, 
	   ax-qmlw/2,ay-qmlw/2,aw+qmlw,ah+qmlw,180*64,-135*64);
  XDrawArc(display,drawable,gc, 
	   ax+qmlw/2,ay+qmlw/2,aw-qmlw,ah-qmlw,45*64,-128*64);
  XDrawLine(display,drawable, gc, lx1-qmlw/2, ly1, lx2-qmlw/2, ly2);
  XDrawLine(display,drawable, gc, lx1-qmlw/2, ly1, lx2+qmlw/2, ly1);
  XDrawArc(display, drawable, gc, dx,dy,dw,dh,45*64,180*64);


  XDrawArc(display,pixmap,gc, 
	   ax-qmlw/2,ay-qmlw/2,aw+qmlw,ah+qmlw,180*64,-135*64);
  XDrawArc(display,pixmap,gc, 
	   ax+qmlw/2,ay+qmlw/2,aw-qmlw,ah-qmlw,45*64,-128*64);
  XDrawLine(display,pixmap, gc, lx1-qmlw/2, ly1, lx2-qmlw/2, ly2);
  XDrawLine(display,pixmap, gc, lx1-qmlw/2, ly1, lx2+qmlw/2, ly1);
  XDrawArc(display, pixmap, gc, dx,dy,dw,dh,45*64,180*64);

  /* draw the bottom shadow 
   */
  XSetForeground(display, gc, bsc);
  XSetLineAttributes(display,gc, qmlw/5,LineSolid,CapButt,JoinMiter);

  /*  XSetLineAttributes(display,gc, 
   * qmlw/5,LineOnOffDash,CapButt,JoinMiter,FillSolid);  
   */

  /* draw mirror image 
   */
  XDrawArc(display,drawable,gc, 
	   ax-qmlw/2,ay-qmlw/2,aw+qmlw,ah+qmlw,45*64,-128*64);
  XDrawArc(display,drawable,gc, 
	   ax+qmlw/2,ay+qmlw/2,aw-qmlw,ah-qmlw,180*64,-135*64);
  XDrawLine(display,drawable, gc, ax-qmlw/2, ay+ah/2, ax+qmlw/2, ay+ah/2);
  XDrawLine(display,drawable, gc, lx1+qmlw/2, ly1+qmlw, lx2+qmlw/2, ly2);
  XDrawLine(display,drawable, gc, lx1-qmlw/2, ly2, lx2+qmlw/2, ly2);
  XDrawArc(display, drawable, gc, dx,dy,dw,dh,225*64,180*64);


  XDrawArc(display,pixmap,gc, 
	   ax-qmlw/2,ay-qmlw/2,aw+qmlw,ah+qmlw,45*64,-128*64);
  XDrawArc(display,pixmap,gc, 
	   ax+qmlw/2,ay+qmlw/2,aw-qmlw,ah-qmlw,180*64,-135*64);
  XDrawLine(display,pixmap, gc, ax-qmlw/2, ay+ah/2, ax+qmlw/2, ay+ah/2);
  XDrawLine(display,pixmap, gc, lx1+qmlw/2, ly1+qmlw, lx2+qmlw/2, ly2);
  XDrawLine(display,pixmap, gc, lx1-qmlw/2, ly2, lx2+qmlw/2, ly2);
  XDrawArc(display, pixmap, gc, dx,dy,dw,dh,225*64,180*64);
}
Esempio n. 8
0
/*+++++++++++++++++++++++++++++++++++++++++++++*/
static void 
build_mainWindow(
        Widget shell )
{
  int        count, n, n2;
  Arg        args[MAX_ARGS];
  Widget     WidgList[10];
  Widget     frame;
  Widget     mainMenu;
  Widget     mainRC;
  Widget     filePulldown;
  Widget     helpPulldown;
  Widget     exitBtn;
  char       *mnemonic;
  char       *tmpStr;
  Pixmap     pixmap;
  XmString   labelString;
  Pixmap     ditherPix;
  XmPixelSet pixelSet[XmCO_NUM_COLORS];
  Pixel      bg;
  short      a,i,p,s;


  /* saveRestore
   * Note that save.poscnt has been initialized elsewhere.  
   * save.posArgs may contain information from restoreAudio().*/

    XtSetArg(save.posArgs[save.poscnt], XmNnoResize, True); save.poscnt++;
    XtSetArg(save.posArgs[save.poscnt], XmNresizePolicy, XmRESIZE_NONE); save.poscnt++;
    style.mainWindow= XmCreateMainWindow(shell,"mainWindow",  save.posArgs, save.poscnt);
    XtAddCallback(style.mainWindow, XmNhelpCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_MAIN_WINDOW);

    n = 0;
    tmpStr = (char *)XtMalloc(strlen(GETMESSAGE(4, 1, "Style Manager"))+1);
    sprintf(tmpStr, GETMESSAGE(4, 1, "Style Manager"));
    XtSetArg(args[n], XmNtitle, tmpStr); n++;
    XtSetArg(args[n], XmNiconName, 
        (char *)GETMESSAGE(4, 37, "Style")); n++;
    XtSetValues(XtParent(style.mainWindow), args, n);
    XtFree(tmpStr);

    n = 0;
    mainMenu= XmCreateMenuBar(style.mainWindow,"mainMenu", args, n);
    XtAddCallback(mainMenu, XmNhelpCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_MENUBAR);
    XtManageChild(mainMenu);

    /* create the pulldown widgets */
    n = 0;
    filePulldown= XmCreatePulldownMenu(mainMenu,"fileMenu", args, n );
    XtAddCallback(filePulldown, XmNhelpCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_FILE_MENU);

    n = 0;
    helpPulldown= XmCreatePulldownMenu(mainMenu, "helpMenu" , args, n );
    XtAddCallback(helpPulldown, XmNhelpCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_HELP_MENU);

    /* create the cascade butons */
    count = 0;

    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 2, "F"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString =  CMPSTR((char *)GETMESSAGE(4, 3, "File"));
    XtSetArg(args[n], XmNlabelString, labelString);  n++;
    XtSetArg(args[n], XmNsubMenuId, filePulldown); n++;
    XtSetArg (args[n], XmNmarginWidth, LB_MARGIN_WIDTH); n++;
    WidgList[count++]= 
        XmCreateCascadeButton(mainMenu, "fileCascadeButton", args, n );
    XtAddCallback(WidgList[count-1], XmNhelpCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_FILE_MENU);
    XmStringFree(labelString);

    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 4, "H"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString =  CMPSTR((char *)GETMESSAGE(4, 5, "Help"));
    XtSetArg(args[n], XmNlabelString, labelString); n++;
    XtSetArg(args[n], XmNsubMenuId, helpPulldown); n++;
    XtSetArg (args[n], XmNmarginWidth, 6); n++;
    WidgList[count++]= 
        XmCreateCascadeButton(mainMenu, "helpCascadeButton", args, n );
    XtAddCallback(WidgList[count-1], XmNhelpCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_HELP_MENU);
    XmStringFree(labelString);

    n = 0;
    XtSetArg(args[n], XmNmenuHelpWidget, WidgList[count-1]);    n++;
    XtSetValues (mainMenu, args, n);

    XtManageChildren (WidgList, count);

    /* create the File menu pane's buttons */
    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 53, "x"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString =  CMPSTR((char *)GETMESSAGE(4, 7, "Exit"));
    XtSetArg(args[n], XmNlabelString, labelString); n++;
    exitBtn= XmCreatePushButton(filePulldown, "exit", args, n );
    XtAddCallback(exitBtn, XmNactivateCallback, activateCB_exitBtn, NULL);
    XtAddCallback(exitBtn, XmNhelpCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_EXIT);
    XtManageChild(exitBtn);
    XmStringFree(labelString);

    /* create the Help menu pane's buttons */
    count =0;

    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 54, "v"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString = CMPSTR((char *)GETMESSAGE(4, 55, "Overview"));
    XtSetArg(args[n], XmNlabelString, labelString); n++;
    WidgList[count++]= 
        XmCreatePushButton(helpPulldown, "overview", args, n );
    XtAddCallback(WidgList[count-1], XmNactivateCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_INTRODUCTION);
    XmStringFree(labelString);

    n = 0;
    WidgList[count++]= 
        XmCreateSeparatorGadget(helpPulldown,"separator",args,n);
            
    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 43, "T"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString = CMPSTR((char *)GETMESSAGE(4, 56, "Tasks"));
    XtSetArg(args[n], XmNlabelString, labelString);  n++;
    WidgList[count++]= XmCreatePushButton(helpPulldown, "tasks", args, n );
    XtAddCallback(WidgList[count-1], XmNactivateCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_TASKS);
    XmStringFree(labelString);

    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 45, "R"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString = CMPSTR((char *)GETMESSAGE(4, 57, "Reference"));
    XtSetArg(args[n], XmNlabelString, labelString);  n++;
    WidgList[count++]= XmCreatePushButton(helpPulldown, "reference", args, n );
    XtAddCallback(WidgList[count-1], XmNactivateCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_REFERENCE);
    XmStringFree(labelString);

    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 47, "O"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString = CMPSTR((char *)GETMESSAGE(4, 48, "On Item"));
    XtSetArg(args[n], XmNlabelString, labelString);  n++;
    WidgList[count++]= XmCreatePushButton(helpPulldown, "onItem", args, n );
    XtAddCallback(WidgList[count-1], XmNactivateCallback,
        (XtCallbackProc)HelpModeCB, (XtPointer)NULL);
    XmStringFree(labelString);

    n = 0;
    WidgList[count++] = 
        XmCreateSeparatorGadget(helpPulldown,"separator",args,n);

    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 49, "U"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString = CMPSTR((char *)GETMESSAGE(4, 58, "Using Help"));
    XtSetArg(args[n], XmNlabelString, labelString); n++;
    WidgList[count++]= 
        XmCreatePushButton(helpPulldown, "usingHelp", args, n );
    XtAddCallback(WidgList[count-1], XmNactivateCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_USING);
    XmStringFree(labelString);

    n = 0;
    WidgList[count++] = 
        XmCreateSeparatorGadget(helpPulldown,"separator",args,n);

    n = 0;
    mnemonic = ((char *)GETMESSAGE(4, 59, "A"));
    XtSetArg(args[n], XmNmnemonic, mnemonic[0]); n++;
    labelString = CMPSTR((char *)GETMESSAGE(4, 60, "About Style Manager"));
    XtSetArg(args[n], XmNlabelString, labelString); n++;
    WidgList[count++]= XmCreatePushButton(helpPulldown, "stylemanager", args, n );
    XtAddCallback(WidgList[count-1], XmNactivateCallback,
        (XtCallbackProc)HelpRequestCB, (XtPointer)HELP_VERSION);
    XmStringFree(labelString);

    XtManageChildren(WidgList, count);

    /*  create frame and row column for icon gadgets */
    n = 0;
    XtSetArg(args[n], XmNresizePolicy, XmRESIZE_NONE); n++;
    XtSetArg(args[n], XmNshadowType, XmSHADOW_OUT); n++;
    XtSetArg(args[n], XmNshadowThickness, 1); n++;
    frame = XmCreateFrame(style.mainWindow, "frame", args, n);
    XtManageChild(frame);
                           
    /* Save pixels for later use                                           */
    /* primary top/bottom shadow -> fg/bg for pixmaps in primary areas     */
    /* secondary top/bottom shadow -> fg/bg for pixmaps in secondary areas */
    /* secondary select color -> backgrounds of editable text areas        */
    /* secondary foreground ->  fill color on toggle indicators            */

    /*  Get the primary colors to be used later */
    n = 0;
    XtSetArg(args[n], XmNbackground, &bg); n++;
    XtGetValues(style.mainWindow, args, n);

    XmGetColors (style.screen, style.colormap, bg,
                 NULL,
                 &style.primTSCol,
                 &style.primBSCol,
                 NULL);

    /*  Get the secondary colors to be used later */
    n = 0;
    XtSetArg(args[n], XmNbackground, &style.secBgCol); n++;
    XtGetValues(exitBtn, args, n);

    XmGetColors (style.screen, style.colormap, style.secBgCol,
                 &style.tgSelectColor,
                 &style.secTSCol,
                 &style.secBSCol,
                 &style.secSelectColor);

    if ((style.secTSCol == style.secBSCol) || /* B_W or shadowPixmaps==True */
        (!style.useMultiColorIcons))          /* multiColorIcons turned off */
    {
        /* force TS = White, BS = Black */
        style.secTSCol = style.primTSCol = WhitePixelOfScreen(style.screen);
        style.secBSCol = style.primBSCol = BlackPixelOfScreen(style.screen);
    }
    
    XmeGetPixelData(style.screenNum, &colorUse, pixelSet, &a, &i, &p, &s);

    n = 0;
    if (colorUse == XmCO_BLACK_WHITE)
    {
    ditherPix = XmGetPixmap (style.screen, "50_foreground",
                             style.primBSCol,style.primTSCol);
    XtSetArg(args[n], XmNbackgroundPixmap, ditherPix); n++;
    }
    XtSetArg(args[n], XmNallowOverlap, False); n++;
    XtSetArg(args[n], XmNadjustLast, False); n++;
    XtSetArg(args[n], XmNpacking, XmPACK_TIGHT); n++;
    XtSetArg(args[n], XmNspacing, style.horizontalSpacing); n++;
    mainRC = XmCreateRowColumn(frame, "mainRC", args, n);
    XtManageChild(mainRC);

    n = 0;
    XtSetArg(args[n], XmNmenuBar, mainMenu);    n++;
    XtSetArg(args[n], XmNcommandWindow, NULL);    n++;
    XtSetArg(args[n], XmNworkWindow, frame);    n++;
    XtSetValues (style.mainWindow, args, n);

    ProcessComponentList (shell, mainRC);

}