summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericm <ericm>2000-04-13 17:36:58 (GMT)
committerericm <ericm>2000-04-13 17:36:58 (GMT)
commitd84476f76305040174e4b07a20a3012a9ace4b21 (patch)
treeb5d1cd70062a66ab710589f8b4437f695c31638e
parent1c06a203ecbe741c83687742b659ab73514a0b00 (diff)
downloadtk-d84476f76305040174e4b07a20a3012a9ace4b21.zip
tk-d84476f76305040174e4b07a20a3012a9ace4b21.tar.gz
tk-d84476f76305040174e4b07a20a3012a9ace4b21.tar.bz2
* generic/tkCanvas.c: Applied patch from [Bug: 4202]; adds a check
for NULL tkwin in Tk_CanvasEventuallyRedraw.
-rw-r--r--ChangeLog23
-rw-r--r--generic/tkCanvas.c28
2 files changed, 41 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 320bd97..1108f4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2000-04-13 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkCanvas.c: Applied patch from [Bug: 4202]; adds a check
+ for NULL tkwin in Tk_CanvasEventuallyRedraw.
+
+2000-04-11 Eric Melski <ericm@scriptics.com>
+
+ * msgcat.n: Added docs for new behavior from patch in [Bug: 4158].
+
+ * msgcat.test: Added tests for new behavior from patch in [Bug:
+ 4158].
+
+ * msgcat.tcl: Applied patch from [Bug: 4158], which enables
+ msgcat::mc to search the entire namespace ancestry chain for
+ message translations (ie, first it checks the current namespace,
+ then the parent, then the parent's parent, etc). Also allows the
+ specification of additional args for msgcat::mc; if extra args are
+ given, the [format] command is used to substitute the additional
+ args in the translated message.
+
+ * library/bgerror.tcl: Moved check for withdrawn state after check
+ for tkerror; this was causing problems when tkerror was used.
+
2000-04-10 Eric Melski <ericm@scriptics.com>
* library/bgerror.tcl: Added check for withdrawn state of . and
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 176e44a..09bde91 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvas.c,v 1.12 2000/03/29 00:09:06 ericm Exp $
+ * RCS: @(#) $Id: tkCanvas.c,v 1.13 2000/04/13 17:36:58 ericm Exp $
*/
/* #define USE_OLD_TAG_SEARCH 1 */
@@ -1931,6 +1931,13 @@ DestroyCanvas(memPtr)
TkCanvas *canvasPtr = (TkCanvas *) memPtr;
Tk_Item *itemPtr;
+ if (canvasPtr->tkwin != NULL) {
+ Tcl_DeleteCommandFromToken(canvasPtr->interp, canvasPtr->widgetCmd);
+ }
+ if (canvasPtr->flags & REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DisplayCanvas, (ClientData) canvasPtr);
+ }
+
/*
* Free up all of the items in the canvas.
*/
@@ -1973,6 +1980,7 @@ DestroyCanvas(memPtr)
Tk_DeleteBindingTable(canvasPtr->bindingTable);
}
Tk_FreeOptions(configSpecs, (char *) canvasPtr, canvasPtr->display, 0);
+ canvasPtr->tkwin = NULL;
ckfree((char *) canvasPtr);
}
@@ -2440,15 +2448,7 @@ CanvasEventProc(clientData, eventPtr)
canvasPtr->flags |= REDRAW_BORDERS;
}
} else if (eventPtr->type == DestroyNotify) {
- if (canvasPtr->tkwin != NULL) {
- canvasPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(canvasPtr->interp,
- canvasPtr->widgetCmd);
- }
- if (canvasPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayCanvas, (ClientData) canvasPtr);
- }
- Tcl_EventuallyFree((ClientData) canvasPtr, DestroyCanvas);
+ DestroyCanvas((ClientData) canvasPtr);
} else if (eventPtr->type == ConfigureNotify) {
canvasPtr->flags |= UPDATE_SCROLLBARS;
@@ -2554,6 +2554,14 @@ Tk_CanvasEventuallyRedraw(canvas, x1, y1, x2, y2)
* Pixels on edge are not redrawn. */
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
+ /*
+ * If tkwin is NULL, the canvas has been destroyed, so we can't really
+ * redraw it.
+ */
+ if (canvasPtr->tkwin == NULL) {
+ return;
+ }
+
if ((x1 >= x2) || (y1 >= y2) ||
(x2 < canvasPtr->xOrigin) || (y2 < canvasPtr->yOrigin) ||
(x1 >= canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin)) ||