comparison lwlib/lwlib-Xm.c @ 12746:23cd08c6dd2a

(xm_popup_menu): New arg `event'.
author Richard M. Stallman <rms@gnu.org>
date Wed, 02 Aug 1995 07:14:04 +0000
parents 10a973a88e87
children 0a94cd2c51c4
comparison
equal deleted inserted replaced
12745:4da8b8ac5211 12746:23cd08c6dd2a
1407 } 1407 }
1408 } 1408 }
1409 1409
1410 /* popup utility */ 1410 /* popup utility */
1411 void 1411 void
1412 xm_popup_menu (widget) 1412 xm_popup_menu (widget, event)
1413 Widget widget; 1413 Widget widget;
1414 XEvent *event;
1414 { 1415 {
1415 XButtonPressedEvent dummy; 1416 XButtonPressedEvent dummy;
1416 XEvent* event; 1417
1417 1418 if (event == 0)
1418 dummy.type = ButtonPress; 1419 {
1419 dummy.serial = 0; 1420 dummy.type = ButtonPress;
1420 dummy.send_event = 0; 1421 dummy.serial = 0;
1421 dummy.display = XtDisplay (widget); 1422 dummy.send_event = 0;
1422 dummy.window = XtWindow (XtParent (widget)); 1423 dummy.display = XtDisplay (widget);
1423 dummy.time = 0; 1424 dummy.window = XtWindow (XtParent (widget));
1424 dummy.button = 0; 1425 dummy.time = 0;
1425 XQueryPointer (dummy.display, dummy.window, &dummy.root, 1426 dummy.button = 0;
1426 &dummy.subwindow, &dummy.x_root, &dummy.y_root, 1427 XQueryPointer (dummy.display, dummy.window, &dummy.root,
1427 &dummy.x, &dummy.y, &dummy.state); 1428 &dummy.subwindow, &dummy.x_root, &dummy.y_root,
1428 event = (XEvent *) &dummy; 1429 &dummy.x, &dummy.y, &dummy.state);
1430 event = (XEvent *) &dummy;
1431 }
1429 1432
1430 if (event->type == ButtonPress || event->type == ButtonRelease) 1433 if (event->type == ButtonPress || event->type == ButtonRelease)
1431 { 1434 {
1432 /* This is so totally ridiculous: there's NO WAY to tell Motif 1435 /* This is so totally ridiculous: there's NO WAY to tell Motif
1433 that *any* button can select a menu item. Only one button 1436 that *any* button can select a menu item. Only one button