APPROVE COMMIT 21.5 RECOMMEND 21.4
Vin: applies with offset +5 and fuzz 1 on hunk 3. Not yet tested in 21.4.
If you put a printf in xlwtabs.c (TabsGeometryManager) immediately
_after_ the test for "position changed or not resizable" at the top of
the function, you should see that without the patch the printf spews
output on every window, frame, or buffer change; with the patch, you
should _never_ see it.
It turns out that the tabs widget has two parts: the row of tabs, and
the children that it controls. In XEmacs, the children are irrelevant
and never displayed; they're only used for their label/name
resources. (What a waste, but never mind....) So there's no point in
doing any geometry negotiation with them ever.
The existing code attempts to set the XtNresizable resource to NULL,
but does so on the _parent_ widget which doesn't actually have such a
resource, not on the individual children. This patch fixes that.
Index: lwlib/ChangeLog
===================================================================
RCS file:
/Users/steve/Software/Repositories/cvs.xemacs.org/XEmacs/xemacs/lwlib/ChangeLog,v
retrieving revision 1.65
diff -u -r1.65 ChangeLog
--- lwlib/ChangeLog 18 Feb 2005 06:29:19 -0000 1.65
+++ lwlib/ChangeLog 8 Mar 2005 15:06:21 -0000
@@ -0,0 +1,6 @@
+2005-03-07 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * lwlib-Xlw.c (build_tabs_in_widget): Correctly disable geometry
+ negotiation for tab children.
+ (xlw_create_tab_control): Don't set nonexistent resizable resource.
+
Index: lwlib/lwlib-Xlw.c
===================================================================
RCS file:
/Users/steve/Software/Repositories/cvs.xemacs.org/XEmacs/xemacs/lwlib/lwlib-Xlw.c,v
retrieving revision 1.13
diff -u -r1.13 lwlib-Xlw.c
--- lwlib/lwlib-Xlw.c 20 Sep 2004 19:19:16 -0000 1.13
+++ lwlib/lwlib-Xlw.c 9 Mar 2005 01:00:58 -0000
@@ -319,13 +319,21 @@
#ifdef LWLIB_TABS_LUCID
/* tab control
- lwlib is such an incredible hairy crock. I just cannot believe
+ [[ lwlib is such an incredible hairy crock. I just cannot believe
it! There are random dependencies between functions, there is a
total lack of genericity, even though it initially appears to be
generic. It should all be junked and begun again. Building tabs are
an example - in theory we should be able to reuse a lot of the
general stuff because we want to put labels of whatever toolkit we
- are using in the tab. Instead we have to hack it by hand. */
+ are using in the tab. Instead we have to hack it by hand. ]]
+ While lwlib is a hairy crock, whoever wrote that seems to misunderstand
+ Falk's tab control widget. The tab control widget has *two* kinds of
+ children: *widgets*, which all occupy a *single* pane below the row of
+ tabs---this is where the labels created in build_tabs_in_widget go, and
+ *gadgets*, the tabs themselves, which do *not* draw themselves, but
+ rather are drawn by the control. In fact, in XEmacs the true widget
+ children are *never* visible! So this case is not a problem in the
+ design of lwlib, but rather of Falk's widget. -- sjt */
static void
xlw_tab_control_callback (Widget w, XtPointer client_data, XtPointer call_data)
{
@@ -375,9 +383,8 @@
widget_value* val = instance->info->val;
XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
+ XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++;
XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++;
- XtSetArg (al [ac], XtNresizable, False); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -396,15 +403,22 @@
Widget widget, widget_value* val)
{
widget_value* cur = val;
+ Arg al[1];
+
+ /* Children are always invisible, don't permit resizing. */
+ XtSetArg (al[0], XtNresizable, False);
+
for (cur = val; cur; cur = cur->next)
{
if (cur->value)
{
+ Widget w;
#ifdef LWLIB_WIDGETS_MOTIF
- xm_create_label (widget, cur);
+ w = xm_create_label (widget, cur);
#else
- xaw_create_label (widget, cur);
+ w = xaw_create_label (widget, cur);
#endif
+ XtSetValues (w, al, 1);
}
cur->change = NO_CHANGE;
}
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.