[ 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)