diff options
Diffstat (limited to 'macosx/tkMacOSXEmbed.c')
-rw-r--r-- | macosx/tkMacOSXEmbed.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 1d66b82..f9700f6 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -207,6 +207,7 @@ TkpUseWindow( MacDrawable *parent, *macWin; Container *containerPtr; + if (winPtr->window != None) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't modify container after widget is created", -1)); @@ -247,14 +248,14 @@ TkpUseWindow( * Container structure, since we only allow the case where both container * and embedded app. are in the same process. */ - + for (containerPtr = firstContainerPtr; containerPtr != NULL; - containerPtr = containerPtr->nextPtr) { - if (containerPtr->parent == (Window) parent) { - winPtr->flags |= TK_BOTH_HALVES; - containerPtr->parentPtr->flags |= TK_BOTH_HALVES; - break; - } + containerPtr = containerPtr->nextPtr) { + if (containerPtr->parent == (Window) parent) { + winPtr->flags |= TK_BOTH_HALVES; + containerPtr->parentPtr->flags |= TK_BOTH_HALVES; + break; + } } /* @@ -313,9 +314,10 @@ TkpUseWindow( if (tkMacOSXEmbedHandler == NULL || tkMacOSXEmbedHandler->registerWinProc((long) parent, (Tk_Window) winPtr) != TCL_OK) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "The window ID %s does not correspond to a valid Tk Window", - string)); + "The window ID %s does not correspond to a valid Tk Window", + string)); Tcl_SetErrorCode(interp, "TK", "EMBED", "HANDLE", NULL); return TCL_ERROR; } @@ -391,7 +393,6 @@ TkpMakeContainer( * sure the argument to -use is valid. */ - Tk_MakeWindowExist(tkwin); containerPtr = ckalloc(sizeof(Container)); containerPtr->parent = Tk_WindowId(tkwin); containerPtr->parentPtr = winPtr; |