summaryrefslogtreecommitdiffstats
path: root/generic/tkMacWinMenu.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-04-16 01:51:06 (GMT)
committerstanton <stanton>1999-04-16 01:51:06 (GMT)
commit03656f44f81469f459031fa3a4a7b09c8bc77712 (patch)
tree31378e81bd58f8c726fc552d6b30cbf3ca07497b /generic/tkMacWinMenu.c
parent404fc236f34304df53b7e44bc7971d786b87d453 (diff)
downloadtk-03656f44f81469f459031fa3a4a7b09c8bc77712.zip
tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.gz
tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.bz2
* Merged 8.1 branch into the main trunk
Diffstat (limited to 'generic/tkMacWinMenu.c')
-rw-r--r--generic/tkMacWinMenu.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/generic/tkMacWinMenu.c b/generic/tkMacWinMenu.c
index 6453a5f..ca77c45 100644
--- a/generic/tkMacWinMenu.c
+++ b/generic/tkMacWinMenu.c
@@ -9,12 +9,16 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacWinMenu.c,v 1.2 1998/09/14 18:23:14 stanton Exp $
+ * RCS: @(#) $Id: tkMacWinMenu.c,v 1.3 1999/04/16 01:51:19 stanton Exp $
*/
#include "tkMenu.h"
-static int postCommandGeneration;
+typedef struct ThreadSpecificData {
+ int postCommandGeneration;
+} ThreadSpecificData;
+static Tcl_ThreadDataKey dataKey;
+
static int PreprocessMenu _ANSI_ARGS_((TkMenu *menuPtr));
@@ -43,6 +47,8 @@ PreprocessMenu(menuPtr)
{
int index, result, finished;
TkMenu *cascadeMenuPtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_Preserve((ClientData) menuPtr);
@@ -67,16 +73,16 @@ PreprocessMenu(menuPtr)
finished = 1;
for (index = 0; index < menuPtr->numEntries; index++) {
if ((menuPtr->entries[index]->type == CASCADE_ENTRY)
- && (menuPtr->entries[index]->name != NULL)) {
+ && (menuPtr->entries[index]->namePtr != NULL)) {
if ((menuPtr->entries[index]->childMenuRefPtr != NULL)
&& (menuPtr->entries[index]->childMenuRefPtr->menuPtr
!= NULL)) {
cascadeMenuPtr =
menuPtr->entries[index]->childMenuRefPtr->menuPtr;
if (cascadeMenuPtr->postCommandGeneration !=
- postCommandGeneration) {
+ tsdPtr->postCommandGeneration) {
cascadeMenuPtr->postCommandGeneration =
- postCommandGeneration;
+ tsdPtr->postCommandGeneration;
result = PreprocessMenu(cascadeMenuPtr);
if (result != TCL_OK) {
goto done;
@@ -128,7 +134,10 @@ int
TkPreprocessMenu(menuPtr)
TkMenu *menuPtr;
{
- postCommandGeneration++;
- menuPtr->postCommandGeneration = postCommandGeneration;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ tsdPtr->postCommandGeneration++;
+ menuPtr->postCommandGeneration = tsdPtr->postCommandGeneration;
return PreprocessMenu(menuPtr);
}