diff options
author | das <das> | 2006-04-22 04:12:25 (GMT) |
---|---|---|
committer | das <das> | 2006-04-22 04:12:25 (GMT) |
commit | 1899aa0c63592f33a10e92fcdb0679ac99e84576 (patch) | |
tree | 12982ca17e3d41a2c531e36d8990a41c9a2b47fa /macosx/tkMacOSXEmbed.c | |
parent | 9c58f434c68e50e58327b833da67a6fd23c839f6 (diff) | |
download | tk-1899aa0c63592f33a10e92fcdb0679ac99e84576.zip tk-1899aa0c63592f33a10e92fcdb0679ac99e84576.tar.gz tk-1899aa0c63592f33a10e92fcdb0679ac99e84576.tar.bz2 |
* macosx/tkMacOSXEmbed.c:
* macosx/tkMacOSXWm.c:
* tests/constraints.tcl:
* tests/wm.test: sync with 2006-04-18 commit to HEAD. (darley)
Diffstat (limited to 'macosx/tkMacOSXEmbed.c')
-rw-r--r-- | macosx/tkMacOSXEmbed.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index b759ffa..802a15c 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.2.2.2 2006/03/28 02:44:13 das Exp $ + * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.2.2.3 2006/04/22 04:12:25 das Exp $ */ #include "tkMacOSXInt.h" @@ -229,10 +229,10 @@ TkpUseWindow( * for tkwin; must be an integer value. */ { TkWindow *winPtr = (TkWindow *) tkwin; + TkWindow *usePtr; MacDrawable *parent, *macWin; Container *containerPtr; XEvent event; - int result; if (winPtr->window != None) { Tcl_AppendResult(interp, "can't modify container after widget is created", (char *) NULL); @@ -249,11 +249,23 @@ TkpUseWindow( * */ - if (Tcl_GetInt(interp, string, &result) != TCL_OK) { + if (Tcl_GetInt(interp, string, (int*) &parent) != TCL_OK) { return TCL_ERROR; } - parent = (MacDrawable *) result; + usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, (Window) 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 @@ -325,7 +337,8 @@ TkpUseWindow( */ if (gMacEmbedHandler == NULL || - gMacEmbedHandler->registerWinProc(result, (Tk_Window) winPtr) != TCL_OK) { + gMacEmbedHandler->registerWinProc((int) parent, + (Tk_Window) winPtr) != TCL_OK) { Tcl_AppendResult(interp, "The window ID ", string, " does not correspond to a valid Tk Window.", (char *) NULL); |