-
- widget_value *tem = (widget_value *) XtMalloc (sizeof (widget_value));
-
- /* _XtCreate is freeing the object we passed,
- so make a copy that we free later. */
- bcopy (instance->info->val, tem, sizeof (widget_value));
-
- widget =
- XtVaCreateWidget (instance->info->name, xlwMenuWidgetClass,
- instance->parent,
- XtNmenu, instance->info->val,
- 0);
-
- XtFree (tem);
+ Arg al[5];
+ int ac = 0;
+
+ XtSetArg (al[ac], XtNmenu, instance->info->val); ac++;
+#ifdef emacs
+ XtSetArg (al[ac], XtNshowGrip, 0); ac++;
+ XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++;
+ XtSetArg (al[ac], XtNallowResize, 1); ac++;
+#endif
+
+ /* This used to use XtVaCreateWidget, but an old Xt version
+ has a bug in XtVaCreateWidget that frees instance->info->name. */
+ widget
+ = XtCreateWidget (instance->info->name, xlwMenuWidgetClass,
+ instance->parent, al, ac);