diff options
author | chengyemao <chengyemao> | 2005-01-12 02:58:29 (GMT) |
---|---|---|
committer | chengyemao <chengyemao> | 2005-01-12 02:58:29 (GMT) |
commit | 4caa27530c1ea45527b8e4dc77242763908cc4f4 (patch) | |
tree | cbf0ec63197f03e7d5763ccf1de4c39a1dd8e535 /win/tkWinEmbed.c | |
parent | d85af204a9d1f218bd5e67862a9b14031760dfb3 (diff) | |
download | tk-4caa27530c1ea45527b8e4dc77242763908cc4f4.zip tk-4caa27530c1ea45527b8e4dc77242763908cc4f4.tar.gz tk-4caa27530c1ea45527b8e4dc77242763908cc4f4.tar.bz2 |
Minor bug fix to support embedding/embedded
Diffstat (limited to 'win/tkWinEmbed.c')
-rw-r--r-- | win/tkWinEmbed.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 538e357..920d479 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.22 2005/01/10 15:35:30 chengyemao Exp $ + * RCS: @(#) $Id: tkWinEmbed.c,v 1.23 2005/01/12 02:58:29 chengyemao Exp $ */ #include "tkWinInt.h" @@ -171,7 +171,8 @@ TkpUseWindow(interp, tkwin, string) if(strcmp(string, "") == 0) { if(winPtr->flags & TK_EMBEDDED) { TkpWinToplevelDetachWindow(winPtr); - TkpWinToplevelOverrideRedirect(winPtr, 0); + if(winPtr->flags & TK_TOP_LEVEL) + TkpWinToplevelOverrideRedirect(winPtr, 0); } return TCL_OK; } @@ -277,7 +278,11 @@ TkpUseWindow(interp, tkwin, string) winPtr->flags |= TK_EMBEDDED; winPtr->flags &= (~(TK_MAPPED)); - Tcl_DoWhenIdle(TkWmMapWindow, (ClientData)winPtr); + if(winPtr->flags & TK_TOP_LEVEL) { + // call this function in idle may crash because the window + // may be destroyed in script + TkWmMapWindow(winPtr); + } return TCL_OK; } |