summaryrefslogtreecommitdiffstats
path: root/mac/tkMacMenu.c
diff options
context:
space:
mode:
authorwelch <welch>1998-06-27 18:06:37 (GMT)
committerwelch <welch>1998-06-27 18:06:37 (GMT)
commitadcb060b5ab8d310f5aff8a1119d3b97baf86641 (patch)
tree759f8786c82028afeb67bd971309b7b328d81d7f /mac/tkMacMenu.c
parentd010dca55fd7a02e3fe6e50910359d8d4915f003 (diff)
downloadtk-adcb060b5ab8d310f5aff8a1119d3b97baf86641.zip
tk-adcb060b5ab8d310f5aff8a1119d3b97baf86641.tar.gz
tk-adcb060b5ab8d310f5aff8a1119d3b97baf86641.tar.bz2
plugin updates
Diffstat (limited to 'mac/tkMacMenu.c')
-rw-r--r--mac/tkMacMenu.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/mac/tkMacMenu.c b/mac/tkMacMenu.c
index 33bb82b..3d58597 100644
--- a/mac/tkMacMenu.c
+++ b/mac/tkMacMenu.c
@@ -139,6 +139,8 @@ typedef struct TopLevelMenubarList {
#define MENUBAR_REDRAW_PENDING 1
+static int gNoTkMenus = 0; /* This is used by Tk_MacTurnOffMenus as the
+ * flag that Tk is not to draw any menus. */
RgnHandle tkMenuCascadeRgn = NULL;
/* The region to clip drawing to when the
* MDEF is up. */
@@ -1396,6 +1398,31 @@ TkpMenuNewEntry(
*----------------------------------------------------------------------
*
*
+ * Tk_MacTurnOffMenus --
+ *
+ * Turns off all the menu drawing code. This is more than just disabling
+ * the "menu" command, this means that Tk will NEVER touch the menubar.
+ * It is needed in the Plugin, where Tk does not own the menubar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A flag is set which will disable all menu drawing.
+ *
+ *----------------------------------------------------------------------
+ */
+
+EXTERN void
+Tk_MacTurnOffMenus()
+{
+ gNoTkMenus = 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ *
* DrawMenuBarWhenIdle --
*
* Update the menu bar next time there is an idle event.
@@ -1419,6 +1446,14 @@ DrawMenuBarWhenIdle(
Tcl_HashEntry *hashEntryPtr;
/*
+ * If we have been turned off, exit.
+ */
+
+ if (gNoTkMenus) {
+ return;
+ }
+
+ /*
* We need to clear the apple and help menus of any extra items.
*/
@@ -3991,4 +4026,6 @@ TkpMenuInit(void)
currentMenuBarInterp = NULL;
currentMenuBarName = NULL;
windowListPtr = NULL;
+ FixMDEF();
+
}