summaryrefslogtreecommitdiffstats
path: root/win/tkWinEmbed.c
diff options
context:
space:
mode:
authorchengyemao <chengyemao>2004-12-18 20:35:16 (GMT)
committerchengyemao <chengyemao>2004-12-18 20:35:16 (GMT)
commit4c1f1e15de61bb5adedc4ea38b18255400ce5167 (patch)
tree656ee9e8996ebab02a612b682e43e772b05bcff2 /win/tkWinEmbed.c
parente0487637c65e27e840c3d34213c702f44c072a7a (diff)
downloadtk-4c1f1e15de61bb5adedc4ea38b18255400ce5167.zip
tk-4c1f1e15de61bb5adedc4ea38b18255400ce5167.tar.gz
tk-4c1f1e15de61bb5adedc4ea38b18255400ce5167.tar.bz2
Bug fix [222677]
Diffstat (limited to 'win/tkWinEmbed.c')
-rw-r--r--win/tkWinEmbed.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index 0010a2d..0ee1f2f 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.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: tkWinEmbed.c,v 1.11 2004/12/17 14:17:54 chengyemao Exp $
+ * RCS: @(#) $Id: tkWinEmbed.c,v 1.12 2004/12/18 20:35:16 chengyemao Exp $
*/
#include "tkWinInt.h"
@@ -367,32 +367,30 @@ TkWinEmbeddedEventProc(hwnd, message, wParam, lParam)
/* empty loop body */
}
- if (containerPtr == NULL) {
- Tcl_Panic("TkWinContainerProc couldn't find Container record");
- }
-
- switch (message) {
- case TK_ATTACHWINDOW:
- /* An embedded window (either from this application or from
- * another application) is trying to attach to this container.
- * We attach it only if this container is not yet containing any
- * window.
- */
- if (containerPtr->embeddedHWnd == NULL) {
- containerPtr->embeddedHWnd = (HWND)wParam;
- } else {
- return 0;
- }
- break;
+ if (containerPtr) {
+ switch (message) {
+ case TK_ATTACHWINDOW:
+ /* An embedded window (either from this application or from
+ * another application) is trying to attach to this container.
+ * We attach it only if this container is not yet containing any
+ * window.
+ */
+ if (containerPtr->embeddedHWnd == NULL) {
+ containerPtr->embeddedHWnd = (HWND)wParam;
+ } else {
+ return 0;
+ }
+ break;
- case TK_DETACHWINDOW:
- containerPtr->embeddedHWnd = NULL;
- containerPtr->parentPtr->flags &= ~TK_BOTH_HALVES;
- break;
+ case TK_DETACHWINDOW:
+ containerPtr->embeddedHWnd = NULL;
+ containerPtr->parentPtr->flags &= ~TK_BOTH_HALVES;
+ break;
- case TK_GEOMETRYREQ:
- EmbedGeometryRequest(containerPtr, (int) wParam, lParam);
- break;
+ case TK_GEOMETRYREQ:
+ EmbedGeometryRequest(containerPtr, (int) wParam, lParam);
+ break;
+ }
}
return 1;
}
@@ -632,6 +630,7 @@ EmbedWindowDeleted(winPtr)
break;
}
if (containerPtr->parentPtr == winPtr) {
+ SendMessage(containerPtr->embeddedHWnd, WM_CLOSE, 0, 0);
containerPtr->parentPtr = NULL;
break;
}