home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume2 / xscope / part01 / FilePopup.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-28  |  1.1 KB  |  46 lines

  1. #include "xsignal.h"
  2.  
  3. extern sigbox *panefromfb();
  4. /* ARGSUSED */
  5. void
  6. file_popup(w, event, params, num_params)
  7. Widget w;
  8. XEvent *event; /* unused */
  9. String *params;
  10. Cardinal *num_params;
  11. {
  12.     /* position the menu, whose name was passed as the first and only
  13.      * parameter at position (20,5) relative to the Widget w.
  14.      */
  15.     sigbox *pane;
  16.     Widget a_shell,wt;
  17.     Window child;
  18.     int x, y, wide;
  19.     Arg args[2];
  20.  
  21.     if (*num_params != 1)
  22.         XtError("Wrong parameter count passed to file_popup()");
  23.  
  24.     /* get the internal Widget id of the named shell */
  25.     pane = panefromfb(w);
  26.     a_shell = pane->file_popup;
  27.  
  28.     if (a_shell == NULL)
  29.         XtError("Wrong shell name passed to file_popup()");
  30.  
  31.     XtSetArg(args[0], XtNheight, &y);
  32.     XtGetValues(w, (ArgList)args, 1);
  33.     XTranslateCoordinates(XtDisplay(w), XtWindow(w),
  34.         XDefaultRootWindow(XtDisplay(w)),
  35.         0,y,&x,&y,&child);
  36.  
  37.     /* currently this is the only way to move created shells */
  38.     XtMoveWidget(a_shell, x, y);
  39.     /* R3 needs just the next section, not the preceeding line */
  40. /*
  41.     XtSetArg(args[0], XtNx, x);
  42.     XtSetArg(args[1], XtNy, y);
  43.     XtSetValues(a_shell, (ArgList)args, 2);
  44. */
  45. }
  46.