summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenu.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2003-02-19 19:27:43 (GMT)
committerwolfsuit <wolfsuit>2003-02-19 19:27:43 (GMT)
commite891595e16225fe441b40805b6bc3f1e9ff7cc75 (patch)
treee88ef97ca29843dc17db985018abfbbb170e7a5d /macosx/tkMacOSXMenu.c
parent6e2cd243ccc9bd454ae118549066ad2669c00160 (diff)
downloadtk-e891595e16225fe441b40805b6bc3f1e9ff7cc75.zip
tk-e891595e16225fe441b40805b6bc3f1e9ff7cc75.tar.gz
tk-e891595e16225fe441b40805b6bc3f1e9ff7cc75.tar.bz2
This submission contains a slightly reworked & cleaned up version of
two parts of the patches in Patch Tracker #622582 - new-evthdlng.2003-02-12.diff and basic-keyboard.2003-02-10.diff. The second part puts translation of MacOS X keycodes to characters on a better footing. The first part relaxs Tk's policy of consuming all events unless it can see they go to windows it didn't create. This change gets the little traffic lights working, and should make things like QuickTimeTcl easier to implement.
Diffstat (limited to 'macosx/tkMacOSXMenu.c')
-rw-r--r--macosx/tkMacOSXMenu.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index bc01a32..d92a8fb 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.5 2003/02/18 14:43:45 vincentdarley Exp $
+ * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.6 2003/02/19 19:27:48 wolfsuit Exp $
*/
#include "tkMacOSXInt.h"
#include "tkMenuButton.h"
@@ -865,35 +865,15 @@ mySetMenuTitle(
MenuRef menuHdl, /* The menu we are setting the title of. */
Tcl_Obj *titlePtr) /* The C string to set the title to. */
{
- char localBuffer[7];
- Boolean success;
char *title = (titlePtr == NULL) ? ""
: Tcl_GetStringFromObj(titlePtr, NULL);
CFStringRef cf = CFStringCreateWithCString(NULL,
title, kCFStringEncodingUTF8);
- success = CFStringGetCString(cf, localBuffer, 7, kCFStringEncodingMacRoman);
- if (success && (localBuffer[0] == '\245')) {
- OSErr err;
- IconSuiteRef ref;
- int iconId = atoi(localBuffer + 1);
- /*
- * Until images/icons are properly supported on MacOS X,
- * we allow the user to specify a bullet followed by
- * a resource id to use an icon as a menu title
- */
- err = GetIconSuite( &ref, iconId, kSelectorAllAvailableData );
- if (err == noErr) {
- SetMenuTitleIcon(menuHdl,kMenuIconSuiteType,ref);
- /* DisposeIconSuite(ref,true); */
- } else {
- SetMenuTitleWithCFString(menuHdl, cf);
- }
- } else {
- SetMenuTitleWithCFString(menuHdl, cf);
- }
+ SetMenuTitleWithCFString(menuHdl, cf);
CFRelease(cf);
}
+
static int ParseAccelerators(char **accelStringPtr) {
char *accelString = *accelStringPtr;
int flags = 0;