changeset 2131:fc29c4c2d386

Mac: Changes for supporting Big Sur. These changes don't actually work. The Xcode beta SDK is listed as 10.16, although it has been reported that Big Sur will be 11.0 not 10.16. The 10.16 SDK does not include constants for either 10.16 or 11.0 so I am writing the code as if it will be 11.0. The 10.16 SDK complains that NSBox's setBorderType is deprecated and it seems like the styles don't apply to the box type I am using anyway, so might want to just remove the setBorderType from NSBox and see if it still works on other versions of MacOS, but committing for now so I have this record of it.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 30 Jun 2020 20:10:23 +0000
parents 55c6587f269c
children 42f8ad7a89e8
files mac/dw.m
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Tue Jun 30 19:17:41 2020 +0000
+++ b/mac/dw.m	Tue Jun 30 20:10:23 2020 +0000
@@ -162,6 +162,11 @@
 #define WK_API_ENABLED 1
 #endif
 
+/* Handle deprecation of constants in 10.16... */
+#if defined(MAC_OS_X_VERSION_11_0) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_11_0) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED))
+#define BUILDING_FOR_BIG_SUR
+#endif
+
 /* Macros to encapsulate running functions on the main thread
  * on Mojave or later... and locking mutexes on earlier versions.
  */
@@ -4441,7 +4446,9 @@
     DWBox *thisbox = dw_box_new(type, pad);
     Box *box = [thisbox box];
 
+#ifndef BUILDING_FOR_BIG_SUR
     [groupbox setBorderType:NSBezelBorder];
+#endif
     [groupbox setTitle:[NSString stringWithUTF8String:title]];
     box->grouphwnd = groupbox;
     [groupbox setContentView:thisbox];
@@ -6387,8 +6394,9 @@
     NSBox *border = [[NSBox alloc] init];
     NSTextField *textfield = dw_text_new(text, cid);
 
+#ifndef BUILDING_FOR_BIG_SUR
     [border setBorderType:NSGrooveBorder];
-    //[border setBorderType:NSLineBorder];
+#endif
     [border setTitlePosition:NSNoTitle];
     [border setContentView:textfield];
     [border setContentViewMargins:NSMakeSize(1.5,1.5)];