summaryrefslogtreecommitdiffstats
path: root/generic/tkScale.c
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-12-21 23:55:09 (GMT)
committerhobbs <hobbs>1999-12-21 23:55:09 (GMT)
commite3249c7140d13964c60a406053e850c11fe0a8d3 (patch)
tree2bdd8c171e7711b0c956672d13d8df8239573690 /generic/tkScale.c
parentc30bbd5faddbda1bb9f7ce951124d2c87110f082 (diff)
downloadtk-e3249c7140d13964c60a406053e850c11fe0a8d3.zip
tk-e3249c7140d13964c60a406053e850c11fe0a8d3.tar.gz
tk-e3249c7140d13964c60a406053e850c11fe0a8d3.tar.bz2
* generic/tk.h:
* README: updated for patch level 8.3b1 * generic/tkScale.c: * generic/tkScale.h: fixed possible core when freeing options (cursor) associated with scale widget [Bug: 3897] * generic/tk3d.c: added extra calculations to ensure that thin frames get refreshed too [Bug: 3596] * generic/tkCanvText.c: * generic/tkEntry.c: * generic/tkFont.c: * generic/tkImgPPM.c: removed extranneous vars that were set but never used.
Diffstat (limited to 'generic/tkScale.c')
-rw-r--r--generic/tkScale.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/generic/tkScale.c b/generic/tkScale.c
index 9ea237c..ee942e9 100644
--- a/generic/tkScale.c
+++ b/generic/tkScale.c
@@ -18,7 +18,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkScale.c,v 1.8 1999/04/21 21:53:27 rjohnson Exp $
+ * RCS: @(#) $Id: tkScale.c,v 1.9 1999/12/21 23:55:11 hobbs Exp $
*/
#include "tkPort.h"
@@ -528,6 +528,13 @@ DestroyScale(memPtr)
{
register TkScale *scalePtr = (TkScale *) memPtr;
+ scalePtr->flags |= SCALE_DELETED;
+
+ Tcl_DeleteCommandFromToken(scalePtr->interp, scalePtr->widgetCmd);
+ if (scalePtr->flags & REDRAW_ALL) {
+ Tcl_CancelIdleCall(TkpDisplayScale, (ClientData) scalePtr);
+ }
+
/*
* Free up all the stuff that requires special handling, then
* let Tk_FreeOptions handle all the standard option-related
@@ -550,6 +557,7 @@ DestroyScale(memPtr)
}
Tk_FreeConfigOptions((char *) scalePtr, scalePtr->optionTable,
scalePtr->tkwin);
+ scalePtr->tkwin = NULL;
TkpDestroyScale(scalePtr);
}
@@ -1022,14 +1030,7 @@ ScaleEventProc(clientData, eventPtr)
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
TkEventuallyRedrawScale(scalePtr, REDRAW_ALL);
} else if (eventPtr->type == DestroyNotify) {
- if (scalePtr->tkwin != NULL) {
- scalePtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(scalePtr->interp, scalePtr->widgetCmd);
- }
- if (scalePtr->flags & REDRAW_ALL) {
- Tcl_CancelIdleCall(TkpDisplayScale, (ClientData) scalePtr);
- }
- Tcl_EventuallyFree((ClientData) scalePtr, DestroyScale);
+ DestroyScale((char *) clientData);
} else if (eventPtr->type == ConfigureNotify) {
ComputeScaleGeometry(scalePtr);
TkEventuallyRedrawScale(scalePtr, REDRAW_ALL);
@@ -1082,8 +1083,7 @@ ScaleCmdDeletedProc(clientData)
* destroys the widget.
*/
- if (tkwin != NULL) {
- scalePtr->tkwin = NULL;
+ if (!(scalePtr->flags & SCALE_DELETED)) {
Tk_DestroyWindow(tkwin);
}
}
@@ -1114,6 +1114,7 @@ TkEventuallyRedrawScale(scalePtr, what)
* or REDRAW_ALL. */
{
if ((what == 0) || (scalePtr->tkwin == NULL)
+ || (scalePtr->flags & SCALE_DELETED)
|| !Tk_IsMapped(scalePtr->tkwin)) {
return;
}