diff options
Diffstat (limited to 'generic/tkFrame.c')
-rw-r--r-- | generic/tkFrame.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 0ea4111..7343b6a 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.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: tkFrame.c,v 1.29 2007/09/07 00:34:52 dgp Exp $ + * RCS: @(#) $Id: tkFrame.c,v 1.30 2007/10/15 20:52:47 hobbs Exp $ */ #include "default.h" @@ -943,10 +943,11 @@ ConfigureFrame( * A few of the options require additional processing. */ - if (((oldMenuName == NULL) && (framePtr->menuName != NULL)) + if ((((oldMenuName == NULL) && (framePtr->menuName != NULL)) || ((oldMenuName != NULL) && (framePtr->menuName == NULL)) || ((oldMenuName != NULL) && (framePtr->menuName != NULL) - && strcmp(oldMenuName, framePtr->menuName) != 0)) { + && strcmp(oldMenuName, framePtr->menuName) != 0)) + && framePtr->type == TYPE_TOPLEVEL) { TkSetWindowMenuBar(interp, framePtr->tkwin, oldMenuName, framePtr->menuName); } @@ -1910,6 +1911,33 @@ FrameLostSlaveProc( FrameWorldChanged((ClientData) framePtr); } +void +TkMapTopFrame (tkwin) + Tk_Window tkwin; +{ + Frame *framePtr = ((TkWindow*)tkwin)->instanceData; + Tk_OptionTable optionTable; + if (Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_FRAME) { + framePtr->type = TYPE_TOPLEVEL; + Tcl_DoWhenIdle(MapFrame, (ClientData)framePtr); + if (framePtr->menuName != NULL) { + TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin, NULL, + framePtr->menuName); + } + } else if (!Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_TOPLEVEL) { + framePtr->type = TYPE_FRAME; + } else { + /* Not a frame or toplevel, skip it */ + return; + } + /* + * The option table has already been created so + * the cached pointer will be returned. + */ + optionTable = Tk_CreateOptionTable(framePtr->interp, optionSpecs[framePtr->type]); + framePtr->optionTable = optionTable; +} + /* *-------------------------------------------------------------- * |