changeset 12745:4da8b8ac5211

(xlw_popup_menu): New arg event.
author Richard M. Stallman <rms@gnu.org>
date Wed, 02 Aug 1995 07:13:45 +0000
parents 0c5625e91a11
children 23cd08c6dd2a
files lwlib/lwlib-Xlw.c
diffstat 1 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/lwlib-Xlw.c	Wed Aug 02 07:13:19 1995 +0000
+++ b/lwlib/lwlib-Xlw.c	Wed Aug 02 07:13:45 1995 +0000
@@ -185,8 +185,9 @@
 }
 
 void
-xlw_popup_menu (widget)
+xlw_popup_menu (widget, event)
      Widget widget;
+     XEvent *event;
 {
   XButtonPressedEvent dummy;
   XlwMenuWidget mw;
@@ -196,18 +197,23 @@
 
   mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
 
-  dummy.type = ButtonPress;
-  dummy.serial = 0;
-  dummy.send_event = 0;
-  dummy.display = XtDisplay (widget);
-  dummy.window = XtWindow (XtParent (widget));
-  dummy.time = CurrentTime;
-  dummy.button = 0;
-  XQueryPointer (dummy.display, dummy.window, &dummy.root,
-		 &dummy.subwindow, &dummy.x_root, &dummy.y_root,
-		 &dummy.x, &dummy.y, &dummy.state);
+  if (event)
+    pop_up_menu (mw, event);
+  else
+    {
+      dummy.type = ButtonPress;
+      dummy.serial = 0;
+      dummy.send_event = 0;
+      dummy.display = XtDisplay (widget);
+      dummy.window = XtWindow (XtParent (widget));
+      dummy.time = CurrentTime;
+      dummy.button = 0;
+      XQueryPointer (dummy.display, dummy.window, &dummy.root,
+		     &dummy.subwindow, &dummy.x_root, &dummy.y_root,
+		     &dummy.x, &dummy.y, &dummy.state);
 
-  pop_up_menu (mw, &dummy);
+      pop_up_menu (mw, &dummy);
+    }
 }
 
 /* Destruction of instances */