comparison lwlib/lwlib-Xm.c @ 36766:93e2f21c32bd

(xm_popup_menu): Don't set XmNmenuPost unless necessary. From Rick Scott <rwscott@alumni.uwaterloo.ca>.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 13 Mar 2001 12:31:36 +0000
parents c94bea694181
children c4fe55798108
comparison
equal deleted inserted replaced
36765:f23a696e7fd0 36766:93e2f21c32bd
1726 event = (XEvent *) &dummy; 1726 event = (XEvent *) &dummy;
1727 } 1727 }
1728 1728
1729 if (event->type == ButtonPress || event->type == ButtonRelease) 1729 if (event->type == ButtonPress || event->type == ButtonRelease)
1730 { 1730 {
1731 /* This is so totally ridiculous: there's NO WAY to tell Motif 1731 /* Setting the menuPost resource only required by Motif 1.1 and
1732 that *any* button can select a menu item. Only one button 1732 LessTif 0.84 and earlier. With later versions of LessTif,
1733 can have that honor. 1733 setting menuPost is unnecessary and may cause problems, so
1734 */ 1734 don't do it. */
1735 char *trans = 0; 1735 #if XmVersion < 1002 || (defined LESSTIF_VERSION && LESSTIF_VERSION < 84)
1736 if (event->xbutton.state & Button5Mask) trans = "<Btn5Down>"; 1736 {
1737 else if (event->xbutton.state & Button4Mask) trans = "<Btn4Down>"; 1737 /* This is so totally ridiculous: there's NO WAY to tell Motif
1738 else if (event->xbutton.state & Button3Mask) trans = "<Btn3Down>"; 1738 that *any* button can select a menu item. Only one button
1739 else if (event->xbutton.state & Button2Mask) trans = "<Btn2Down>"; 1739 can have that honor. */
1740 else if (event->xbutton.state & Button1Mask) trans = "<Btn1Down>"; 1740
1741 if (trans) XtVaSetValues (widget, XmNmenuPost, trans, NULL); 1741 char *trans = 0;
1742 if (event->xbutton.state & Button5Mask) trans = "<Btn5Down>";
1743 else if (event->xbutton.state & Button4Mask) trans = "<Btn4Down>";
1744 else if (event->xbutton.state & Button3Mask) trans = "<Btn3Down>";
1745 else if (event->xbutton.state & Button2Mask) trans = "<Btn2Down>";
1746 else if (event->xbutton.state & Button1Mask) trans = "<Btn1Down>";
1747 if (trans) XtVaSetValues (widget, XmNmenuPost, trans, NULL);
1748 }
1749 #endif
1750
1742 XmMenuPosition (widget, (XButtonPressedEvent *) event); 1751 XmMenuPosition (widget, (XButtonPressedEvent *) event);
1743 } 1752 }
1753
1744 XtManageChild (widget); 1754 XtManageChild (widget);
1745 } 1755 }
1746 1756
1747 static void 1757 static void
1748 set_min_dialog_size (w) 1758 set_min_dialog_size (w)