diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-09-16 22:03:48 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-09-16 22:03:48 (GMT) |
commit | 76d9a30bfaf8b9ae70bcbab9cbe66c487129bd56 (patch) | |
tree | 01bf37ba54f3c4f0bc6e599909eb63eba5078144 /macosx | |
parent | a3ba233aee169f23ead09b373bcabe49fef5965e (diff) | |
parent | 6ab1d5ec9aa0ecf66cf454b289ccfe7a25cdd717 (diff) | |
download | tk-76d9a30bfaf8b9ae70bcbab9cbe66c487129bd56.zip tk-76d9a30bfaf8b9ae70bcbab9cbe66c487129bd56.tar.gz tk-76d9a30bfaf8b9ae70bcbab9cbe66c487129bd56.tar.bz2 |
Merge 8.7
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/README | 2 | ||||
-rw-r--r-- | macosx/Tk-Common.xcconfig | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXColor.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXDialog.c | 67 | ||||
-rw-r--r-- | macosx/tkMacOSXFont.c | 3 | ||||
-rw-r--r-- | macosx/tkMacOSXInit.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXMenu.c | 18 | ||||
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 7 | ||||
-rw-r--r-- | macosx/tkMacOSXNotify.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXTest.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 64 | ||||
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 2 |
14 files changed, 93 insertions, 92 deletions
diff --git a/macosx/README b/macosx/README index 52cbb1e..49e614e 100644 --- a/macosx/README +++ b/macosx/README @@ -545,7 +545,7 @@ appropriate place to drain the main NSAutoreleasePool and replace it with a new pool. This is done by calling the method [NSApp _resetAutoreleasePool], where _resetAutoreleasePool is a method which we define for the subclass. Unfortunately, by itself this is not -sufficient for safe memory managememt because, as was made painfully +sufficient for safe memory management because, as was made painfully evident with the release of OS X 10.13, it is possible for calls to TclDoOneEvent, and hence to CheckProc, to be nested. Draining the autorelease pool in a nested call leads to crashes as objects in use diff --git a/macosx/Tk-Common.xcconfig b/macosx/Tk-Common.xcconfig index 508384f..6322430 100644 --- a/macosx/Tk-Common.xcconfig +++ b/macosx/Tk-Common.xcconfig @@ -41,5 +41,5 @@ TCL_LIBRARY = $(LIBDIR)/tcl$(VERSION) TCL_PACKAGE_PATH = "$(LIBDIR)" TCL_DEFS = HAVE_TCL_CONFIG_H TK_LIBRARY = $(LIBDIR)/tk$(VERSION) -TK_DEFS = HAVE_TK_CONFIG_H TCL_NO_DEPRECATED +TK_DEFS = HAVE_TK_CONFIG_H VERSION = 8.7 diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index ffb520d..4732ddb 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -299,7 +299,7 @@ GetRGBA( /* * Prior to OSX 10.14, getComponents returns black when applied to - * windowBackGroundColor. + * windowBackgroundColor. */ if ([NSApp macOSVersion] < 101400) { diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 03d3cf2..4c1566b 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -461,7 +461,7 @@ Tk_ChooseColorObjCmd( [colorPanel setShowsAlpha: NO]; [colorPanel _setUseModalAppearance:YES]; if (title) { - NSString *s = [[NSString alloc] initWithUTF8String:title]; + NSString *s = [[TKNSString alloc] initWithTclUtfBytes:title length:-1]; [colorPanel setTitle:s]; [s release]; @@ -533,7 +533,7 @@ parseFileFilters( if (filterInfo.doFileTypes) { for (FileFilter *filterPtr = fl.filters; filterPtr; filterPtr = filterPtr->next) { - NSString *name = [[NSString alloc] initWithUTF8String: filterPtr->name]; + NSString *name = [[TKNSString alloc] initWithTclUtfBytes: filterPtr->name length:-1]; [filterInfo.fileTypeNames addObject:name]; [name release]; @@ -551,7 +551,7 @@ parseFileFilters( str++; } if (*str) { - NSString *extension = [[NSString alloc] initWithUTF8String:str]; + NSString *extension = [[TKNSString alloc] initWithTclUtfBytes:str length:-1]; if (![filterInfo.allowedExtensions containsObject:extension]) { [filterInfo.allowedExtensions addObject:extension]; } @@ -604,7 +604,7 @@ parseFileFilters( const char *selectedFileType = Tcl_GetString(selectedFileTypeObj); NSString *selectedFileTypeStr = - [[NSString alloc] initWithUTF8String:selectedFileType]; + [[TKNSString alloc] initWithTclUtfBytes:selectedFileType length:-1]; NSUInteger index = [filterInfo.fileTypeNames indexOfObject:selectedFileTypeStr]; @@ -695,20 +695,21 @@ Tk_GetOpenFileObjCmd( case OPEN_INITDIR: str = Tcl_GetStringFromObj(objv[i + 1], &len); if (len) { - directory = [[[NSString alloc] initWithUTF8String:str] + directory = [[[TKNSString alloc] initWithTclUtfBytes:str length:len] autorelease]; } break; case OPEN_INITFILE: str = Tcl_GetStringFromObj(objv[i + 1], &len); if (len) { - filename = [[[NSString alloc] initWithUTF8String:str] + filename = [[[TKNSString alloc] initWithTclUtfBytes:str length:len] autorelease]; } break; case OPEN_MESSAGE: - message = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetStringFromObj(objv[i + 1], &len); + message = [[TKNSString alloc] initWithTclUtfBytes: + str length:len]; break; case OPEN_MULTIPLE: if (Tcl_GetBooleanFromObj(interp, objv[i + 1], @@ -725,8 +726,9 @@ Tk_GetOpenFileObjCmd( haveParentOption = 1; break; case OPEN_TITLE: - title = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetStringFromObj(objv[i + 1], &len); + title = [[TKNSString alloc] initWithTclUtfBytes: + str length:len]; break; case OPEN_TYPEVARIABLE: typeVariablePtr = objv[i + 1]; @@ -960,10 +962,10 @@ Tk_GetSaveFileObjCmd( case SAVE_DEFAULT: str = Tcl_GetStringFromObj(objv[i + 1], &len); while (*str && (*str == '*' || *str == '.')) { - str++; + str++; len--; } if (*str) { - defaultType = [[[NSString alloc] initWithUTF8String:str] + defaultType = [[[TKNSString alloc] initWithTclUtfBytes:str length:len] autorelease]; } break; @@ -973,21 +975,22 @@ Tk_GetSaveFileObjCmd( case SAVE_INITDIR: str = Tcl_GetStringFromObj(objv[i + 1], &len); if (len) { - directory = [[[NSString alloc] initWithUTF8String:str] + directory = [[[TKNSString alloc] initWithTclUtfBytes:str length:len] autorelease]; } break; case SAVE_INITFILE: str = Tcl_GetStringFromObj(objv[i + 1], &len); if (len) { - filename = [[[NSString alloc] initWithUTF8String:str] + filename = [[[TKNSString alloc] initWithTclUtfBytes:str length:len] autorelease]; [savepanel setNameFieldStringValue:filename]; } break; case SAVE_MESSAGE: - message = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetStringFromObj(objv[i + 1], &len); + message = [[TKNSString alloc] initWithTclUtfBytes: + str length:len]; break; case SAVE_PARENT: str = Tcl_GetStringFromObj(objv[i + 1], &len); @@ -998,8 +1001,9 @@ Tk_GetSaveFileObjCmd( haveParentOption = 1; break; case SAVE_TITLE: - title = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetStringFromObj(objv[i + 1], &len); + title = [[TKNSString alloc] initWithTclUtfBytes: + str length:len]; break; case SAVE_TYPEVARIABLE: typeVariablePtr = objv[i + 1]; @@ -1198,13 +1202,14 @@ Tk_ChooseDirectoryObjCmd( case CHOOSE_INITDIR: str = Tcl_GetStringFromObj(objv[i + 1], &len); if (len) { - directory = [[[NSString alloc] initWithUTF8String:str] + directory = [[[TKNSString alloc] initWithTclUtfBytes:str length:len] autorelease]; } break; case CHOOSE_MESSAGE: - message = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetStringFromObj(objv[i + 1], &len); + message = [[TKNSString alloc] initWithTclUtfBytes: + str length:len]; [panel setMessage:message]; [message release]; break; @@ -1223,8 +1228,9 @@ Tk_ChooseDirectoryObjCmd( haveParentOption = 1; break; case CHOOSE_TITLE: - title = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetStringFromObj(objv[i + 1], &len); + title = [[TKNSString alloc] initWithTclUtfBytes: + str length:len]; [panel setTitle:title]; [title release]; break; @@ -1387,8 +1393,9 @@ Tk_MessageBoxObjCmd( break; case ALERT_DETAIL: - message = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetString(objv[i + 1]); + message = [[TKNSString alloc] initWithTclUtfBytes: + str length:-1]; [alert setInformativeText:message]; [message release]; break; @@ -1401,8 +1408,9 @@ Tk_MessageBoxObjCmd( break; case ALERT_MESSAGE: - message = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetString(objv[i + 1]); + message = [[TKNSString alloc] initWithTclUtfBytes: + str length:-1]; [alert setMessageText:message]; [message release]; break; @@ -1417,8 +1425,9 @@ Tk_MessageBoxObjCmd( break; case ALERT_TITLE: - title = [[NSString alloc] initWithUTF8String: - Tcl_GetString(objv[i + 1])]; + str = Tcl_GetString(objv[i + 1]); + title = [[TKNSString alloc] initWithTclUtfBytes: + str length:-1]; [[alert window] setTitle:title]; [title release]; break; diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 1d4de67..f0e1d15 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -244,7 +244,7 @@ FindNSFont( NSString *family; if (familyName) { - family = [[[NSString alloc] initWithUTF8String:familyName] autorelease]; + family = [[[TKNSString alloc] initWithTclUtfBytes:familyName length:-1] autorelease]; } else { family = [defaultFont familyName]; } @@ -1254,7 +1254,6 @@ TkpDrawCharsInContext( * whole (not just the range) string when * drawing. */ { - (void)display; TkpDrawAngledCharsInContext(display, drawable, gc, tkfont, source, numBytes, rangeStart, rangeLength, x, y, 0.0); } diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 9443dbe..8045483 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -424,7 +424,7 @@ TkpInit( /* * TkpInit can be called multiple times with different interpreters. But - * The application initialization should only be done onece. + * The application initialization should only be done once. */ if (!initialized) { @@ -485,7 +485,7 @@ TkpInit( * the application icon, will be delivered before the procedure meant * to to handle the AppleEvent has been defined. This is handled in * tkMacOSXHLEvents.c by scheduling a timer event to handle the - * ApplEvent later, after the required procedure has been defined. + * AppleEvent later, after the required procedure has been defined. */ [NSApp _setup:interp]; diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 41496a8..f703e59 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -121,7 +121,7 @@ static int ModifierCharWidth(Tk_Font tkfont); * demo would cause the animation to stop. This was also the case for * menubuttons. * - * The TKBackground object below works around this problem, and allows a Tk + * The TKBackgroundLoop object below works around this problem, and allows a Tk * event loop to run while a menu is open. It is a subclass of NSThread which * inserts requests to call [NSApp _runBackgroundLoop] onto the queue * associated with the NSEventTrackingRunLoopMode. One of these threads gets @@ -235,8 +235,8 @@ TKBackgroundLoop *backgroundLoop = nil; - (id) initWithTkMenu: (TkMenu *) tkMenu { - NSString *title = [[NSString alloc] initWithUTF8String: - Tk_PathName(tkMenu->tkwin)]; + NSString *title = [[TKNSString alloc] initWithTclUtfBytes: + Tk_PathName(tkMenu->tkwin) length:-1]; self = [self initWithTitle:title]; [title release]; @@ -734,9 +734,9 @@ TkpConfigureMenuEntry( [menuItem setImage:image]; if ((!image || mePtr->compound != COMPOUND_NONE) && mePtr->labelPtr && mePtr->labelLength) { - title = [[[NSString alloc] initWithBytes:Tcl_GetString(mePtr->labelPtr) - length:mePtr->labelLength encoding:NSUTF8StringEncoding] - autorelease]; + title = [[TKNSString alloc] + initWithTclUtfBytes:Tcl_GetString(mePtr->labelPtr) + length:mePtr->labelLength]; if ([title hasSuffix:@"..."]) { title = [NSString stringWithFormat:@"%@%C", [title substringToIndex:[title length] - 3], 0x2026]; @@ -807,7 +807,7 @@ TkpConfigureMenuEntry( if ([submenu supermenu] && [menuItem submenu] != submenu) { /* * This happens during a clone, where the parent menu is - * cloned before its children, so just ignore this temprary + * cloned before its children, so just ignore this temporary * setting, it will be changed shortly (c.f. tkMenu.c * CloneMenu()) */ @@ -1307,7 +1307,7 @@ ParseAccelerator( if (ch) { return [[[NSString alloc] initWithCharacters:&ch length:1] autorelease]; } else { - return [[[[NSString alloc] initWithUTF8String:accel] autorelease] + return [[[[TKNSString alloc] initWithTclUtfBytes:accel length:-1] autorelease] lowercaseString]; } } @@ -1317,7 +1317,7 @@ ParseAccelerator( * * ModifierCharWidth -- * - * Helper mesuring width of command char in given font. + * Helper measuring width of command char in given font. * * Results: * Width of command char. diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 891421f..53292b3 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -143,6 +143,7 @@ enum { buttonState &= ~Tk_GetButtonMask(button); break; case NSLeftMouseDragged: + buttonState |= Tk_GetButtonMask(button); if (![NSApp tkDragTarget]) { if (isOutside) { ignoreDrags = YES; @@ -258,7 +259,7 @@ enum { } /* - * If this click will change the focus, the Tk event event should + * If this click will change the focus, the Tk event should * be sent to the toplevel which will be receiving focus rather than to * the current focus window. So reset tkEventTarget. */ @@ -414,7 +415,6 @@ enum { * not in the grabber's subtree. */ - if (grabWinPtr && /* There is a grab in effect ... */ !winPtr->dispPtr->grabFlags && /* and it is a local grab ... */ grabWinPtr->mainPtr == winPtr->mainPtr){ /* in the same application. */ @@ -510,7 +510,7 @@ enum { Tk_UpdatePointer((Tk_Window) [NSApp tkDragTarget], global.x, global.y, state); } else { - Tk_UpdatePointer(NULL, global.x, global.y, state); + Tk_UpdatePointer(NULL, global.x, global.y, state); } } else if (eventType == NSMouseMoved || eventType == NSLeftMouseDragged) { @@ -849,7 +849,6 @@ GenerateButtonEvent( tkwin = Tk_TopCoordsToWindow(tkwin, medPtr->local.h, medPtr->local.v, &dummy, &dummy); } - Tk_UpdatePointer(tkwin, medPtr->global.h, medPtr->global.v, medPtr->state); return true; } diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 293e7ea..19441c5 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -344,7 +344,7 @@ TkMacOSXNotifyExitHandler( * deQueue=NO so that it will not change anything on the AppKit event * queue, because we only want the side effect that it runs drawRect. The * only times when any NSViews have the needsDisplay property set to YES - * are during execution of this function or in the addDirtyRect method + * are during execution of this function or in the addTkDirtyRect method * of TKContentView. * * The reason for running this function as an idle task is to try to diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 5c6a746..5a16e23 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -308,9 +308,6 @@ XUnmapWindow( TkWindow *winPtr = macWin->winPtr; TkWindow *parentPtr = winPtr->parentPtr; NSWindow *win = TkMacOSXGetNSWindowForDrawable(window); - NSPoint mouse = [NSEvent mouseLocation]; - int x = mouse.x, y = TkMacOSXZeroScreenHeight() - mouse.y; - int state = TkMacOSXButtonKeyState(); if (!window) { return BadWindow; @@ -371,7 +368,6 @@ XUnmapWindow( if (view != [NSView focusView]) { [view addTkDirtyRect:[view bounds]]; } - Tk_UpdatePointer(NULL, x, y, state); return Success; } diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index a8d770b..0578a45 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -295,8 +295,8 @@ InjectKeyEventObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "option keysym ?arg?"); return TCL_ERROR; } - if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0, - &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings, + sizeof(char *), "option", 0, &index) != TCL_OK) { return TCL_ERROR; } type = types[index]; diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 297774e..d990c81 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -457,7 +457,7 @@ static void RefocusGrabWindow(void *data) { * being run inside of the drawRect method. If not, it may be desirable * for the display procedure to simply clear the REDRAW_PENDING flag * and return. The widget can be recorded in order to schedule a - * redraw, via and Expose event, from within drawRect. + * redraw, via an Expose event, from within drawRect. * * This is also needed for some tests, especially of the Text widget, * which record data in a global Tcl variable and assume that display @@ -1014,7 +1014,7 @@ ConfigureRestrictProc( /* * Make sure that the layer uses a contentScale that matches the - * backing scale factor of the screen. This avoids blurry text whe + * backing scale factor of the screen. This avoids blurry text when * the view is on a Retina display, as well as incorrect size when * the view is on a normal display. */ diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 7552bae..fcfe247 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1198,14 +1198,14 @@ Tk_WmObjCmd( return TCL_ERROR; } if (objc == 2) { - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(wmTracing != 0)); + Tcl_SetObjResult(interp, Tcl_NewBooleanObj(wmTracing)); return TCL_OK; } return Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing); } - if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, - "option", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings, + sizeof(char *), "option", 0, &index) != TCL_OK) { return TCL_ERROR; } @@ -1542,20 +1542,20 @@ WmGetAttribute( result = Tcl_NewBooleanObj([macWindow styleMask] & NSFullScreenWindowMask); break; case WMATT_MODIFIED: - result = Tcl_NewWideIntObj([macWindow isDocumentEdited] != 0); + result = Tcl_NewBooleanObj([macWindow isDocumentEdited]); break; case WMATT_NOTIFY: - result = Tcl_NewWideIntObj(tkMacOSXWmAttrNotifyVal != 0); + result = Tcl_NewBooleanObj(tkMacOSXWmAttrNotifyVal); break; case WMATT_TITLEPATH: result = Tcl_NewStringObj([[macWindow representedFilename] UTF8String], -1); break; case WMATT_TOPMOST: - result = Tcl_NewWideIntObj((wmPtr->flags & WM_TOPMOST) != 0); + result = Tcl_NewBooleanObj(wmPtr->flags & WM_TOPMOST); break; case WMATT_TRANSPARENT: - result = Tcl_NewWideIntObj((wmPtr->flags & WM_TRANSPARENT) != 0); + result = Tcl_NewBooleanObj(wmPtr->flags & WM_TRANSPARENT); break; case WMATT_TYPE: result = Tcl_NewStringObj("unsupported", -1); @@ -1614,8 +1614,8 @@ WmAttributesCmd( } Tcl_SetObjResult(interp, result); } else if (objc == 4) { /* wm attributes $win -attribute */ - if (Tcl_GetIndexFromObj(interp, objv[3], WmAttributeNames, - "attribute", 0, &attribute) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[3], WmAttributeNames, + sizeof(char *), "attribute", 0, &attribute) != TCL_OK) { return TCL_ERROR; } Tcl_SetObjResult(interp, WmGetAttribute(winPtr, macWindow, (WmAttribute)attribute)); @@ -1623,8 +1623,8 @@ WmAttributesCmd( int i; for (i = 3; i < objc; i += 2) { - if (Tcl_GetIndexFromObj(interp, objv[i], WmAttributeNames, - "attribute", 0, &attribute) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[i], WmAttributeNames, + sizeof(char *), "attribute", 0, &attribute) != TCL_OK) { return TCL_ERROR; } if (WmSetAttribute(winPtr, macWindow, interp, (WmAttribute)attribute, objv[i+1]) @@ -1963,8 +1963,8 @@ WmFocusmodelCmd( return TCL_OK; } - if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, - "argument", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings, + sizeof(char *), "argument", 0, &index) != TCL_OK) { return TCL_ERROR; } if (index == OPT_ACTIVE) { @@ -3113,7 +3113,7 @@ WmOverrideredirectCmd( if (objc == 3) { Tcl_SetObjResult(interp, Tcl_NewBooleanObj( - Tk_Attributes((Tk_Window) winPtr)->override_redirect)); + Tk_Attributes((Tk_Window)winPtr)->override_redirect)); return TCL_OK; } @@ -3175,8 +3175,8 @@ WmPositionfromCmd( if (*Tcl_GetString(objv[3]) == '\0') { wmPtr->sizeHintsFlags &= ~(USPosition|PPosition); } else { - if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, - "argument", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings, + sizeof(char *), "argument", 0, &index) != TCL_OK) { return TCL_ERROR; } if (index == OPT_USER) { @@ -3331,10 +3331,8 @@ WmResizableCmd( if (objc == 3) { Tcl_Obj *results[2]; - results[0] = Tcl_NewWideIntObj( - (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) == 0); - results[1] = Tcl_NewWideIntObj( - (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) == 0); + results[0] = Tcl_NewBooleanObj(!(wmPtr->flags & WM_WIDTH_NOT_RESIZABLE)); + results[1] = Tcl_NewBooleanObj(!(wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)); Tcl_SetObjResult(interp, Tcl_NewListObj(2, results)); return TCL_OK; } @@ -3421,8 +3419,8 @@ WmSizefromCmd( if (*Tcl_GetString(objv[3]) == '\0') { wmPtr->sizeHintsFlags &= ~(USSize|PSize); } else { - if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, - "argument", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings, + sizeof(char *), "argument", 0, &index) != TCL_OK) { return TCL_ERROR; } if (index == OPT_USER) { @@ -3550,8 +3548,8 @@ WmStackorderCmd( ckfree(windows); - if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, - "argument", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings, + sizeof(char *), "argument", 0, &index) != TCL_OK) { return TCL_ERROR; } if (index == OPT_ISABOVE) { @@ -3559,7 +3557,7 @@ WmStackorderCmd( } else { /* OPT_ISBELOW */ result = index1 < index2; } - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result != 0)); + Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result)); return TCL_OK; } } @@ -3617,8 +3615,8 @@ WmStateCmd( return TCL_ERROR; } - if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, - "argument", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings, + sizeof(char *), "argument", 0, &index) != TCL_OK) { return TCL_ERROR; } @@ -5474,7 +5472,7 @@ TkSetWMName( return; } - NSString *title = [[NSString alloc] initWithUTF8String:titleUid]; + NSString *title = [[TKNSString alloc] initWithTclUtfBytes:titleUid length:-1]; [TkMacOSXGetNSWindowForDrawable(winPtr->window) setTitle:title]; [title release]; } @@ -5699,8 +5697,8 @@ TkUnsupported1ObjCmd( return TCL_ERROR; } - if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, - "option", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcmds, + sizeof(char *), "option", 0, &index) != TCL_OK) { return TCL_ERROR; } switch((enum SubCmds) index) { @@ -6029,7 +6027,7 @@ WmWinTabbingId( * allows you to get or set the appearance for the NSWindow associated * with a Tk Window. The syntax is: * - * tk::unsupported::MacWindowStyle tabbingid window ?newAppearance? + * tk::unsupported::MacWindowStyle appearance window ?newAppearance? * * Allowed appearance names are "aqua", "darkaqua", and "auto". * @@ -6101,8 +6099,8 @@ WmWinAppearance( } if (objc == 4) { int index; - if (Tcl_GetIndexFromObj(interp, objv[3], appearanceStrings, - "appearancename", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[3], appearanceStrings, + sizeof(char *), "appearancename", 0, &index) != TCL_OK) { return TCL_ERROR; } switch ((enum appearances) index) { diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index fd1b995..ca3b2ad 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -285,7 +285,7 @@ static CGRect NormalizeButtonBounds( */ /* - * For systems older than 10.14, [NSColor windowBackGroundColor] generates + * For systems older than 10.14, [NSColor windowBackgroundColor] generates * garbage when called from this function. In 10.14 it works correctly, and * must be used in order to have a background color which responds to Dark * Mode. So we use this hard-wired RGBA color on the older systems which don't |