summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authormdejong <mdejong>2002-05-27 17:33:26 (GMT)
committermdejong <mdejong>2002-05-27 17:33:26 (GMT)
commitf2ec5d37bb3e769fe75dd9a0ebd90ed8e5799864 (patch)
treec7b04c113fc582c6f1a250ccdc79fea74d634d4a /win
parentfbf182998e38265316eb57dcd882b13a5e066134 (diff)
downloadtk-f2ec5d37bb3e769fe75dd9a0ebd90ed8e5799864.zip
tk-f2ec5d37bb3e769fe75dd9a0ebd90ed8e5799864.tar.gz
tk-f2ec5d37bb3e769fe75dd9a0ebd90ed8e5799864.tar.bz2
* tests/embed.test: Added cross platform embed tests.
Check that window passed to -use has the -container option set. * tests/wm.test: Remove useless catch call. Deiconify . just in case, stackorder tests will not pass unless it is in the normal state. Add -container flag to embedded stackorder test. * unix/tkUnixEmbed.c (TkpUseWindow): * win/tkWinEmbed.c (TkpUseWindow): Lookup Tk window based on the id passed in as the value for -use. Generate an error if the Tk window did not have the -container option set.
Diffstat (limited to 'win')
-rw-r--r--win/tkWinEmbed.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index 6fdcfc6..0c3f33a 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.4 2000/07/06 03:17:44 mo Exp $
+ * RCS: @(#) $Id: tkWinEmbed.c,v 1.5 2002/05/27 17:33:26 mdejong Exp $
*/
#include "tkWinInt.h"
@@ -148,6 +148,7 @@ TkpUseWindow(interp, tkwin, string)
* for tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
+ TkWindow *usePtr;
int id;
HWND hwnd;
Container *containerPtr;
@@ -177,6 +178,15 @@ TkpUseWindow(interp, tkwin, string)
return TCL_ERROR;
}
+ usePtr = (TkWindow *) Tk_HWNDToWindow(hwnd);
+ if (usePtr != NULL) {
+ if (!(usePtr->flags & TK_CONTAINER)) {
+ Tcl_AppendResult(interp, "window \"", usePtr->pathName,
+ "\" doesn't have -container option set", (char *) NULL);
+ return TCL_ERROR;
+ }
+ }
+
/*
* Store the parent window in the platform private data slot so
* TkWmMapWindow can use it when creating the wrapper window.