(void) sprintf(error_buf, "%s '%s'", "Xaw - SimpleMenuWidget: could not find menu named: ", params[0]); XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
char *err1 = "Xaw - SimpleMenuWidget: could not find menu named: "; char *perr; int len;  len = strlen(err1) + strlen(params[0]) + 2 + 1; perr = XtStackAlloc(len, error_buf); if (perr == NULL) return; sprintf(perr, "%s'%s'", err1, params[0]); XtAppWarning(XtWidgetToApplicationContext(w), perr); XtStackFree(perr, error_buf);
PositionMenuAction(w, event, params, num_params)Widget w;XEvent * event;String * params;Cardinal * num_params;{   Widget menu;  XPoint loc;  if (*num_params != 1) {    char error_buf[BUFSIZ];    (void) sprintf(error_buf, "%s %s",	    "Xaw - SimpleMenuWidget: position menu action expects only one",	    "parameter which is the name of the menu.");    XtAppWarning(XtWidgetToApplicationContext(w), error_buf);    return;  }  if ( (menu = FindMenu(w, params[0])) == NULL) {    char error_buf[BUFSIZ];    (void) sprintf(error_buf, "%s '%s'",	    "Xaw - SimpleMenuWidget: could not find menu named: ", params[0]);    XtAppWarning(XtWidgetToApplicationContext(w), error_buf);    return;  }    switch (event->type) {  case ButtonPress:  case ButtonRelease:    loc.x = event->xbutton.x_root;    loc.y = event->xbutton.y_root;    PositionMenu(menu, &loc);    break;  case EnterNotify:  case LeaveNotify:    loc.x = event->xcrossing.x_root;    loc.y = event->xcrossing.y_root;    PositionMenu(menu, &loc);    break;  case MotionNotify:    loc.x = event->xmotion.x_root;    loc.y = event->xmotion.y_root;    PositionMenu(menu, &loc);    break;  default:    PositionMenu(menu, (XPoint *)NULL);    break;  }}  