summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixEmbed.c
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 /unix/tkUnixEmbed.c
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 'unix/tkUnixEmbed.c')
-rw-r--r--unix/tkUnixEmbed.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c
index e996a0b..5a64713 100644
--- a/unix/tkUnixEmbed.c
+++ b/unix/tkUnixEmbed.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: tkUnixEmbed.c,v 1.3 1999/04/16 01:51:46 stanton Exp $
+ * RCS: @(#) $Id: tkUnixEmbed.c,v 1.4 2002/05/27 17:33:26 mdejong Exp $
*/
#include "tkInt.h"
@@ -105,6 +105,7 @@ TkpUseWindow(interp, tkwin, string)
* for tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
+ TkWindow *usePtr;
int id, anyError;
Window parent;
Tk_ErrorHandler handler;
@@ -121,6 +122,15 @@ TkpUseWindow(interp, tkwin, string)
}
parent = (Window) id;
+ usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, parent);
+ 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;
+ }
+ }
+
/*
* Tk sets the window colormap to the screen default colormap in
* tkWindow.c:AllocWindow. This doesn't work well for embedded