You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
#include <stdlib.h>
#include <unistd.h>
}
static void
-xm_update_cascadebutton (widget_instance* instance, Widget widget,
- widget_value* val)
+xm_update_cascadebutton (instance, widget, val)
+ widget_instance* instance;
+ Widget widget;
+ widget_value* val;
{
/* Should also rebuild the menu by calling ...update_menu... */
XtRemoveAllCallbacks (widget, XmNcascadingCallback);
}
else
{
- menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
+ menu = XmCreatePulldownMenu (widget, cur->name, NULL, 0);
make_menu_in_widget (instance, menu, cur->contents);
XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
button = XmCreateCascadeButton (widget, cur->name, al, ac);
{
if (contents)
{
- menu = XmCreatePulldownMenu (XtParent (widget), "pulldown", NULL, 0);
+ menu = XmCreatePulldownMenu (XtParent (widget), XtName (widget), NULL, 0);
make_menu_in_widget (instance, menu, contents);
ac = 0;
XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
/* This function is for activating a button from a program. It's wrong because
we pass a NULL argument in the call_data which is not Motif compatible.
This is used from the XmNdefaultAction callback of the List widgets to
- have a dble-click put down a dialog box like the button woudl do.
+ have a double-click put down a dialog box like the button would do.
I could not find a way to do that with accelerators.
*/
static void
-activate_button (Widget widget, XtPointer closure, XtPointer call_data)
+activate_button (widget, closure, call_data)
+ Widget widget;
+ XtPointer closure;
+ XtPointer call_data;
{
Widget button = (Widget)closure;
XtCallCallbacks (button, XmNactivateCallback, NULL);
n_children++;
}
- /* invisible seperator button */
+ /* invisible separator button */
ac = 0;
XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++;
children [n_children] = XmCreateLabel (row, "separator_button", al, ac);
\f/* popup utility */
void
-xm_popup_menu (widget)
+xm_popup_menu (widget, event)
Widget widget;
+ XEvent *event;
{
XButtonPressedEvent dummy;
- XEvent* event;
-
- dummy.type = ButtonPress;
- dummy.serial = 0;
- dummy.send_event = 0;
- dummy.display = XtDisplay (widget);
- dummy.window = XtWindow (XtParent (widget));
- dummy.time = 0;
- dummy.button = 0;
- XQueryPointer (dummy.display, dummy.window, &dummy.root,
- &dummy.subwindow, &dummy.x_root, &dummy.y_root,
- &dummy.x, &dummy.y, &dummy.state);
- event = (XEvent *) &dummy;
+
+ if (event == 0)
+ {
+ dummy.type = ButtonPress;
+ dummy.serial = 0;
+ dummy.send_event = 0;
+ dummy.display = XtDisplay (widget);
+ dummy.window = XtWindow (XtParent (widget));
+ dummy.time = 0;
+ dummy.button = 0;
+ XQueryPointer (dummy.display, dummy.window, &dummy.root,
+ &dummy.subwindow, &dummy.x_root, &dummy.y_root,
+ &dummy.x, &dummy.y, &dummy.state);
+ event = (XEvent *) &dummy;
+ }
if (event->type == ButtonPress || event->type == ButtonRelease)
{