summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXColor.c
diff options
context:
space:
mode:
authorculler <culler>2020-08-04 11:56:44 (GMT)
committerculler <culler>2020-08-04 11:56:44 (GMT)
commit6115c6c774ebf6d95e16b18fd3378d691f26722d (patch)
treed39f16cbbf480d5cd1b9b0d9c4320874078f17e2 /macosx/tkMacOSXColor.c
parent05e2467be12d011c71cba6baeccc440aeccf884b (diff)
downloadtk-6115c6c774ebf6d95e16b18fd3378d691f26722d.zip
tk-6115c6c774ebf6d95e16b18fd3378d691f26722d.tar.gz
tk-6115c6c774ebf6d95e16b18fd3378d691f26722d.tar.bz2
Address compiler warnings about dark mode when building on new systems with old targets.
Diffstat (limited to 'macosx/tkMacOSXColor.c')
-rw-r--r--macosx/tkMacOSXColor.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index ce91520..64c9cf2 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -40,9 +40,12 @@ void initColorTable()
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
int newPtr, index = 0;
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
- darkAqua = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
- lightAqua = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
+ if (@available(macOS 10.14, *)) {
+ darkAqua = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
+ lightAqua = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
+ }
#endif
/*
@@ -378,21 +381,19 @@ TkMacOSXInDarkMode(Tk_Window tkwin)
int result = false;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
-
- if ([NSApp macOSVersion] >= 101400) {
+ if (@available(macOS 10.14, *)) {
TkWindow *winPtr = (TkWindow*) tkwin;
NSView *view = nil;
if (winPtr && winPtr->privatePtr) {
view = TkMacOSXDrawableView(winPtr->privatePtr);
}
if (view) {
- result = (view.effectiveAppearance.name == NSAppearanceNameDarkAqua);
+ result = (view.effectiveAppearance == darkAqua);
} else {
- result = ([NSAppearance currentAppearance].name == NSAppearanceNameDarkAqua);
+ result = ([NSAppearance currentAppearance] == darkAqua);
}
}
#endif
-
return result;
}