diff options
author | culler <culler> | 2019-11-19 00:46:50 (GMT) |
---|---|---|
committer | culler <culler> | 2019-11-19 00:46:50 (GMT) |
commit | 8974b47b859c48701323a72dab851fe81a8cb0d6 (patch) | |
tree | 1b3e0fa93c9116280cdd13154a20fbe1cfcdb1bd | |
parent | f3e045cc474203fdfb1a77892eadfba33275509c (diff) | |
download | tk-8974b47b859c48701323a72dab851fe81a8cb0d6.zip tk-8974b47b859c48701323a72dab851fe81a8cb0d6.tar.gz tk-8974b47b859c48701323a72dab851fe81a8cb0d6.tar.bz2 |
Correct some errors revealed by building on macOS 10.6
-rw-r--r-- | macosx/tkMacOSXDraw.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 4 | ||||
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 17 |
3 files changed, 12 insertions, 11 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index f19198d..1bf2572 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -503,7 +503,7 @@ TkMacOSXGetNSImageWithTkImage( { Pixmap pixmap; NSImage *nsImage; - if (width == 0 | height == 0) { + if (width == 0 || height == 0) { return nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0,0)]; } pixmap = Tk_GetPixmap(display, None, width, height, 0); diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 677f77e..1aa9b73 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -293,7 +293,7 @@ static unsigned isFunctionKey(unsigned int code); NSString *str; str = ([aString isKindOfClass: [NSAttributedString class]]) ? - str = [aString string] : aString; + [aString string] : aString; len = [str length]; if (NS_KEYLOG) { @@ -396,7 +396,7 @@ static unsigned isFunctionKey(unsigned int code); NSString *str; str = ([aString isKindOfClass: [NSAttributedString class]]) ? - str = [aString string] : aString; + [aString string] : aString; if (focusWin) { diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 952aa20..7e8377e 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -1409,8 +1409,10 @@ static void ButtonElementDraw( } else if (info.kind == kThemePushButton && (state & TTK_STATE_PRESSED)) { bounds.size.height += 2; - GradientFillRoundedRectangle(dc.context, bounds, 4, - pressedPushButtonGradient, 2); + if ([NSApp macMinorVersion] > 8) { + GradientFillRoundedRectangle(dc.context, bounds, 4, + pressedPushButtonGradient, 2); + } } else { /* @@ -1859,18 +1861,17 @@ static void ComboboxElementDraw( BEGIN_DRAWING(d) bounds.origin.y += 1; if (TkMacOSXInDarkMode(tkwin)) { - bounds.size.height += 1; + bounds.size.height += 1; DrawDarkButton(bounds, info.kind, state, dc.context); - } else if ([NSApp macMinorVersion] > 8) { - if ((state & TTK_STATE_BACKGROUND) && - !(state & TTK_STATE_DISABLED)) { + } else if ([NSApp macMinorVersion] > 8) { + if ((state & TTK_STATE_BACKGROUND) && + !(state & TTK_STATE_DISABLED)) { NSColor *background = [NSColor textBackgroundColor]; CGRect innerBounds = CGRectInset(bounds, 1, 2); SolidFillRoundedRectangle(dc.context, innerBounds, 4, background); } - ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, - NULL); } + ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL); END_DRAWING } |