User: stephent
Date: 05/03/09 06:58:56
Modified: xemacs/lwlib ChangeLog lwlib-Xlw.c
Log:
Stop geometry thrashing in tabs widget
<87vf81e4z9.fsf(a)tleepslib.sk.tsukuba.ac.jp>
Revision Changes Path
1.66 +6 -0 XEmacs/xemacs/lwlib/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/ChangeLog,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- ChangeLog 2005/02/18 06:29:19 1.65
+++ ChangeLog 2005/03/09 05:58:54 1.66
@@ -1,3 +1,9 @@
+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.
+
2005-02-18 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.19 "chives" is released.
1.14 +20 -6 XEmacs/xemacs/lwlib/lwlib-Xlw.c
Index: lwlib-Xlw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/lwlib-Xlw.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- lwlib-Xlw.c 2004/09/20 19:19:16 1.13
+++ lwlib-Xlw.c 2005/03/09 05:58:54 1.14
@@ -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;
}
Show replies by date