I'm confused as to why this is necessary, does the attached patch have the
same effect?
Thanks
andy
2002-06-07 Andy Piper <andy(a)xemacs.org>
* lwlib-Xm.c: (xm_safe_update_label): new function. Call
xm_update_label if the class is appropriate.
(make_menu_in_widget): use it.
(update_one_menu_entry): ditto.
(xm_update_one_widget): ditto.
-----Original Message-----
From: xemacs-beta-admin(a)xemacs.org
[mailto:xemacs-beta-admin@xemacs.org]On Behalf Of Darryl Okahata
Sent: Tuesday, May 14, 2002 5:21 PM
To: xemacs-patches(a)xemacs.org
Cc: XEmacs Beta List
Subject: 21.4.8: fix minor Motif buglet
[ We may have to think a bit about this patch. ]
For some reason, XEmacs calls XtGetValues() upon widgets for which
the XmNlabelType resource does not exist. This causes garbage to be
returned for the XmNlabelType resource, which makes XEmacs think that
the widget is a label widget and then attempt to update the widget's
label. This patch has XEmacs not attempt to update non-label widgets,
but it uses Motif kludgery to do so: because XtGetValues() is a void
function, we set the variable, "type", to some "illegal" value
before
calling XtGetValues(), and then check to see if the illegal value is
still there after calling XtGetValues().
Because of this, this patch is really just a simple workaround. I
suspect the real fix is to prevent xm_update_label() from being called
on non-label widgets (which I assume is the case, for widgets without
an XmNlabelType resource). However, I don't have the time to fully
investigate this.
[ I should say that I actually found this bug some months ago, and have
been using this fix for all that time, without any problems. ]
--
Darryl Okahata
darrylo(a)soco.agilent.com
http://web.soco.agilent.com/~darrylo/
ChangeLog entry:
2002-05-14 Darryl Okahata <darrylo(a)xemacs.org>
* lwlib-Xm.c: prevent non-label widgets from being treated as
labels and having their "labels" updated.
==================================================================
=============
*** lwlib/lwlib-Xm.c.orig Tue Apr 30 09:05:59 2002
--- lwlib/lwlib-Xm.c Mon May 13 10:08:22 2002
***************
*** 208,220 ****
XmString name_string = NULL;
Arg al [20];
int ac = 0;
! int type;
/* Don't clobber pixmap types. */
XtSetArg (al [0], XmNlabelType, &type);
XtGetValues (widget, al, 1);
! if (type == XmPIXMAP)
return;
if (val->value)
--- 208,220 ----
XmString name_string = NULL;
Arg al [20];
int ac = 0;
! int type = 0; /* type == 0 is undefined, and not used by Motif */
/* Don't clobber pixmap types. */
XtSetArg (al [0], XmNlabelType, &type);
XtGetValues (widget, al, 1);
! if (type == XmPIXMAP || type == 0)
return;
if (val->value)