From 11a20a86ed32944334777fe72ba20dea04657822 Mon Sep 17 00:00:00 2001 From: vincentdarley Date: Tue, 18 Apr 2006 22:16:02 +0000 Subject: fix to embed.test failures --- ChangeLog | 5 +++++ macosx/tkMacOSXEmbed.c | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 46e0d77..fe19908 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-18 Vince Darley + + * macosx/tkMacOSXEmbed.c: fix to [Bug 1088814] test failures in + embed.test + 2006-04-11 Peter Spjuth * generic/tkWindow.c (Tk_NameToWindow): Allow NULL interp to diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index d6358f9..42d2c07 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.5 2006/03/24 14:58:01 das Exp $ + * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.6 2006/04/18 22:16:02 vincentdarley Exp $ */ #include "tkMacOSXInt.h" @@ -229,6 +229,7 @@ TkpUseWindow( * for tkwin; must be an integer value. */ { TkWindow *winPtr = (TkWindow *) tkwin; + TkWindow *usePtr; MacDrawable *parent, *macWin; Container *containerPtr; XEvent event; @@ -255,6 +256,20 @@ TkpUseWindow( parent = (MacDrawable *) result; + 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", NULL); + return TCL_ERROR; + } + } + + /* + * The code below can probably be simplified given we have already + * discovered 'usePtr' above. + */ + /* * Save information about the container and the embedded window * in a Container structure. Currently, there must already be an existing -- cgit v0.12