Re: Stripcharts grows and grows

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Wed, 7 Aug 1996 17:19:03 +0200

zaitcev@lab.sun.mcst.ru (Pete A. Zaitcev) wrote:

> I met a difficulty with tkined. Every time when I save a view and
> restart tkined all stripcharts grow larger (at 10 x 10 pixels).
> The grow also when I select 'Resize' and grasp a stripchart but
> do not move the mouse pointer. Whe button is released the stripchart
> gets larger.

> I tried to fix tkiStripchart.c, but failed. Can somebody explain
> how Tk's geometry manager gets fooled by the stripchart?

Below is a patch that should fix this problem. I did not test this fix
extensively. Let me know if there are still problems.

Juergen

*** tkiStripchart.c.orig Tue Jul 16 19:31:05 1996
--- tkiStripchart.c Wed Aug 7 17:06:21 1996
***************
*** 653,663 ****
} else {
stripPtr->textWidth = stripPtr->textHeight = 0;
}
! #endif
stripPtr->header.x1 -= 3;
stripPtr->header.y1 -= 3;
stripPtr->header.x2 += 3;
stripPtr->header.y2 += 3;
}

/*
--- 653,664 ----
} else {
stripPtr->textWidth = stripPtr->textHeight = 0;
}
!
stripPtr->header.x1 -= 3;
stripPtr->header.y1 -= 3;
stripPtr->header.x2 += 3;
stripPtr->header.y2 += 3;
+ #endif
}

/*
*** tkiBarchart.c.orig Tue Jul 16 19:31:02 1996
--- tkiBarchart.c Wed Aug 7 17:13:39 1996
***************
*** 130,139 ****
TK_CONFIG_NULL_OK},
{TK_CONFIG_COLOR, "-fill", (char *) NULL, (char *) NULL,
(char *) NULL, Tk_Offset(BarchartItem, color), TK_CONFIG_NULL_OK},
! {TK_CONFIG_COLOR, "-outline", (char *) NULL, (char *) NULL,
"black", Tk_Offset(BarchartItem, outlineColor),
TK_CONFIG_NULL_OK},
! {TK_CONFIG_COLOR, "-scaleline", (char *) NULL, (char *) NULL,
"black", Tk_Offset(BarchartItem, scalelineColor), TK_CONFIG_NULL_OK},
{TK_CONFIG_INT, "-scalelinestyle", (char *) NULL, (char *) NULL,
"4", Tk_Offset(BarchartItem, scalelineStyle),
--- 130,139 ----
TK_CONFIG_NULL_OK},
{TK_CONFIG_COLOR, "-fill", (char *) NULL, (char *) NULL,
(char *) NULL, Tk_Offset(BarchartItem, color), TK_CONFIG_NULL_OK},
! {TK_CONFIG_COLOR, "-outline", (char *) NULL, (char *) NULL,
"black", Tk_Offset(BarchartItem, outlineColor),
TK_CONFIG_NULL_OK},
! {TK_CONFIG_COLOR, "-scaleline", (char *) NULL, (char *) NULL,
"black", Tk_Offset(BarchartItem, scalelineColor), TK_CONFIG_NULL_OK},
{TK_CONFIG_INT, "-scalelinestyle", (char *) NULL, (char *) NULL,
"4", Tk_Offset(BarchartItem, scalelineStyle),
***************
*** 581,588 ****

barPtr->header.x1 = barPtr->bbox[0] - 1;
barPtr->header.y1 = barPtr->bbox[1] - 1;
! barPtr->header.x2 = barPtr->bbox[2] + 2;
! barPtr->header.y2 = barPtr->bbox[3] + 2;
}

/*
--- 581,588 ----

barPtr->header.x1 = barPtr->bbox[0] - 1;
barPtr->header.y1 = barPtr->bbox[1] - 1;
! barPtr->header.x2 = barPtr->bbox[2] + 0.5;
! barPtr->header.y2 = barPtr->bbox[3] + 0.5;
}

/*