changeset 2641:f7e2b977e15c

[xemacs-hg @ 2005-03-09 05:58:54 by stephent] Stop geometry thrashing in tabs widget <87vf81e4z9.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 09 Mar 2005 05:58:54 +0000
parents a4040d921acc
children 368e26e0b1e3
files lwlib/ChangeLog lwlib/lwlib-Xlw.c
diffstat 2 files changed, 26 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/ChangeLog	Wed Mar 09 05:36:50 2005 +0000
+++ b/lwlib/ChangeLog	Wed Mar 09 05:58:54 2005 +0000
@@ -1,3 +1,9 @@
+2005-03-07  Stephen J. Turnbull  <stephen@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.
+
 2005-02-18  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.19 "chives" is released.
--- a/lwlib/lwlib-Xlw.c	Wed Mar 09 05:36:50 2005 +0000
+++ b/lwlib/lwlib-Xlw.c	Wed Mar 09 05:58:54 2005 +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;
     }