summaryrefslogtreecommitdiff
path: root/lwlib/lwlib-Xlw.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-02-23 08:39:25 +0000
committerRichard M. Stallman <rms@gnu.org>1994-02-23 08:39:25 +0000
commitc52de5eb23d80b964cebe1d7376818e0de933229 (patch)
tree79b6fce27025b6176598821945b2a9a410efee02 /lwlib/lwlib-Xlw.c
parente55c21bea72663cd74018be0aebbf019b8f8ace5 (diff)
downloademacs-c52de5eb23d80b964cebe1d7376818e0de933229.tar.gz
*** empty log message ***
Diffstat (limited to 'lwlib/lwlib-Xlw.c')
-rw-r--r--lwlib/lwlib-Xlw.c55
1 files changed, 22 insertions, 33 deletions
diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c
index 4b48b231a4d..61b2d5b0562 100644
--- a/lwlib/lwlib-Xlw.c
+++ b/lwlib/lwlib-Xlw.c
@@ -77,25 +77,16 @@ xlw_create_menubar (instance)
widget_instance* instance;
{
Widget widget;
+ Arg al[1];
+ int ac = 0;
- /* Don't use malloc_widget_value, because the freeing will be done by free.
- (Also it wastes time calling memset). */
- widget_value *tem = (widget_value *) malloc (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));
+ XtSetArg (al[ac], XtNmenu, instance->info->val); ac++;
+ /* This used to use XtVaCreateWidget, but an old Xt version
+ has a bug in XtVaCreateWidget that frees instance->info->name. */
widget
- = XtVaCreateWidget (instance->info->name, xlwMenuWidgetClass,
- instance->parent,
- XtNmenu, tem,
- 0);
-
-#if 0 /* XtVaCreateWidget frees this, at least in the X11R4
- version that is running on mole.gnu.ai.mit.edu. */
- free_widget_value (tem);
-#endif
+ = XtCreateWidget (instance->info->name, xlwMenuWidgetClass,
+ instance->parent, al, ac);
XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance);
XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
@@ -111,25 +102,17 @@ xlw_create_popup_menu (instance)
instance->parent, NULL, 0);
Widget widget;
+ Arg al[2];
+ int ac = 0;
- /* Don't use malloc_widget_value, because the freeing will be done by free.
- (Also it wastes time calling memset). */
- widget_value *tem = (widget_value *) malloc (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));
+ XtSetArg (al[ac], XtNmenu, instance->info->val); ac++;
+ XtSetArg (al[ac], XtNhorizontal, False); ac++;
+ /* This used to use XtVaManagedCreateWidget, but an old Xt version
+ has a bug in XtVaManagedCreateWidget that frees instance->info->name. */
widget
- = XtVaCreateManagedWidget ("popup", xlwMenuWidgetClass,
- popup_shell,
- XtNmenu, tem,
- XtNhorizontal, False,
- 0);
-
-#if 0
- free_widget_value (tem);
-#endif
+ = XtCreateManagedWidget ("popup", xlwMenuWidgetClass,
+ popup_shell, al, ac);
XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
@@ -166,12 +149,18 @@ xlw_update_one_widget (instance, widget, val, deep_p)
Boolean deep_p;
{
XlwMenuWidget mw;
+ Arg al[1];
if (XtIsShell (widget))
mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
else
mw = (XlwMenuWidget)widget;
- XtVaSetValues (widget, XtNmenu, val, 0);
+
+ /* This used to use XtVaSetValues, but some old Xt versions
+ that have a bug in XtVaCreateWidget might have it here too. */
+ XtSetArg (al[0], XtNmenu, instance->info->val);
+
+ XtSetValues (widget, al, 1);
}
void