summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixEmbed.c
diff options
context:
space:
mode:
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