Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | 3235256 - Keep menu entry IDs out of system values. Thanks Colin McDonald. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
6b6c9d82f7115caa390550124086a464 |
User & Date: | dgp 2011-12-22 18:43:12 |
Context
2012-01-19
| ||
19:53 | [Bug-3021557]: Moving the cursor in elided text freezes Tk check-in: 34eab8bf user: jan.nijtmans tags: trunk | |
2011-12-22
| ||
18:43 | 3235256 - Keep menu entry IDs out of system values. Thanks Colin McDonald. check-in: 6b6c9d82 user: dgp tags: trunk | |
18:42 | 3235256 - Keep menu entry IDs out of system values. Thanks Colin McDonald. check-in: 39071084 user: dgp tags: core-8-5-branch | |
2011-12-13
| ||
11:22 | Make example follow best practices. check-in: 0c6e7a48 user: dkf tags: trunk | |
Changes
Changes to win/tkWinMenu.c.
︙ | ︙ | |||
209 210 211 212 213 214 215 | */ static int GetNewID( TkMenuEntry *mePtr, /* The menu we are working with. */ WORD *menuIDPtr) /* The resulting id. */ { | | | > > > > | < > | | > > | > > | < < > | > | | | | < < | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | */ static int GetNewID( TkMenuEntry *mePtr, /* The menu we are working with. */ WORD *menuIDPtr) /* The resulting id. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); WORD curID = tsdPtr->lastCommandID; while (1) { Tcl_HashEntry *commandEntryPtr; int new; /* * Try the next ID number, taking care to wrap rather than stray * into the system menu IDs. [Bug 3235256] */ if (++curID >= 0xF000) { curID = 1; } /* Return error when we've checked all IDs without success. */ if (curID == tsdPtr->lastCommandID) { return TCL_ERROR; } commandEntryPtr = Tcl_CreateHashEntry(&tsdPtr->commandTable, (char *) curID, &new); if (new) { Tcl_SetHashValue(commandEntryPtr, mePtr); *menuIDPtr = curID; tsdPtr->lastCommandID = curID; return TCL_OK; } } } /* *---------------------------------------------------------------------- * * FreeID -- * |
︙ | ︙ |