summaryrefslogtreecommitdiffstats
path: root/generic/tkBind.c
diff options
context:
space:
mode:
authorchengyemao <chengyemao>2004-05-13 01:36:11 (GMT)
committerchengyemao <chengyemao>2004-05-13 01:36:11 (GMT)
commit2b6d1fdca0d22a89e4f6d4a172f30b331299d55a (patch)
treebc394f46118fb23df43896a049188ac4799dcce6 /generic/tkBind.c
parent21c3d3be6510e3e818c4404cd52fe6f98a17d9d3 (diff)
downloadtk-2b6d1fdca0d22a89e4f6d4a172f30b331299d55a.zip
tk-2b6d1fdca0d22a89e4f6d4a172f30b331299d55a.tar.gz
tk-2b6d1fdca0d22a89e4f6d4a172f30b331299d55a.tar.bz2
Modified HandleEventGenerate to properly generate <Destroy> event
Diffstat (limited to 'generic/tkBind.c')
-rw-r--r--generic/tkBind.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 438a9b4..8682de6 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkBind.c,v 1.32 2004/03/17 18:15:42 das Exp $
+ * RCS: @(#) $Id: tkBind.c,v 1.33 2004/05/13 01:36:11 chengyemao Exp $
*/
#include "tkPort.h"
@@ -3392,6 +3392,14 @@ HandleEventGenerate(interp, mainWin, objc, objv)
event.xany.display = Tk_Display(tkwin);
flags = flagArray[event.xany.type];
+ if (flags & DESTROY) {
+ /*
+ * Event DesotryNotify should be generated by destroying
+ * the window.
+ */
+ Tk_DestroyWindow(tkwin);
+ return TCL_OK;
+ }
if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
event.xkey.state = pat.needMods;
if ((flags & KEY) && (event.xany.type != MouseWheelEvent)) {
@@ -3402,7 +3410,7 @@ HandleEventGenerate(interp, mainWin, objc, objv)
((XVirtualEvent *) &event)->name = pat.detail.name;
}
}
- if (flags & (CREATE|DESTROY|UNMAP|MAP|REPARENT|CONFIG|GRAVITY|CIRC)) {
+ if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG|GRAVITY|CIRC)) {
event.xcreatewindow.window = event.xany.window;
}
@@ -3767,7 +3775,7 @@ HandleEventGenerate(interp, mainWin, objc, objv)
if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
- if (flags & (CREATE|DESTROY|UNMAP|MAP|REPARENT|CONFIG
+ if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG
|GRAVITY|CIRC)) {
event.xcreatewindow.window = Tk_WindowId(tkwin2);
} else {