diff options
author | mdejong <mdejong> | 2002-05-27 17:33:26 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2002-05-27 17:33:26 (GMT) |
commit | 717618cf1c5064691abc8e4c200af7c109d688a9 (patch) | |
tree | c7b04c113fc582c6f1a250ccdc79fea74d634d4a /unix | |
parent | c19b3eb722ba8c6dd0d936b8ed1af843d676ff34 (diff) | |
download | tk-717618cf1c5064691abc8e4c200af7c109d688a9.zip tk-717618cf1c5064691abc8e4c200af7c109d688a9.tar.gz tk-717618cf1c5064691abc8e4c200af7c109d688a9.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')
-rw-r--r-- | unix/tkUnixEmbed.c | 12 |
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 |