|
11 | 11 |
|
12 | 12 | /* Proper way to check for the OS X version we are compiling for, from |
13 | 13 | * https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html |
14 | | - */ |
15 | | -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 |
16 | | -#define COMPILING_FOR_10_7 |
17 | | -#endif |
18 | 14 |
|
19 | | -/* Renamed symbols cause deprecation warnings, so define macros for the new |
| 15 | + * Renamed symbols cause deprecation warnings, so define macros for the new |
20 | 16 | * names if we are compiling on an older SDK */ |
21 | | -#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101000 |
22 | | -#define NSModalResponseOK NSOKButton |
23 | | -#endif |
24 | | -#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 |
25 | | -#define NSEventMaskAny NSAnyEventMask |
26 | | -#define NSEventTypeApplicationDefined NSApplicationDefined |
27 | | -#define NSEventModifierFlagCommand NSCommandKeyMask |
28 | | -#define NSEventModifierFlagControl NSControlKeyMask |
29 | | -#define NSEventModifierFlagOption NSAlternateKeyMask |
30 | | -#define NSEventModifierFlagShift NSShiftKeyMask |
31 | | -#define NSEventTypeKeyUp NSKeyUp |
32 | | -#define NSEventTypeKeyDown NSKeyDown |
33 | | -#define NSEventTypeMouseMoved NSMouseMoved |
34 | | -#define NSEventTypeLeftMouseDown NSLeftMouseDown |
35 | | -#define NSEventTypeRightMouseDown NSRightMouseDown |
36 | | -#define NSEventTypeOtherMouseDown NSOtherMouseDown |
37 | | -#define NSEventTypeLeftMouseDragged NSLeftMouseDragged |
38 | | -#define NSEventTypeRightMouseDragged NSRightMouseDragged |
39 | | -#define NSEventTypeOtherMouseDragged NSOtherMouseDragged |
40 | | -#define NSEventTypeLeftMouseUp NSLeftMouseUp |
41 | | -#define NSEventTypeRightMouseUp NSRightMouseUp |
42 | | -#define NSEventTypeOtherMouseUp NSOtherMouseUp |
43 | | -#define NSWindowStyleMaskClosable NSClosableWindowMask |
44 | | -#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask |
45 | | -#define NSWindowStyleMaskResizable NSResizableWindowMask |
46 | | -#define NSWindowStyleMaskTitled NSTitledWindowMask |
47 | | -#endif |
48 | 17 | #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400 |
49 | 18 | #define NSButtonTypeMomentaryLight NSMomentaryLightButton |
50 | 19 | #define NSButtonTypePushOnPushOff NSPushOnPushOffButton |
@@ -895,9 +864,7 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); } |
895 | 864 | NSSize scale; |
896 | 865 |
|
897 | 866 | rect = NSMakeRect(0, 0, imagesize, imagesize); |
898 | | -#ifdef COMPILING_FOR_10_7 |
899 | 867 | rect = [window convertRectToBacking: rect]; |
900 | | -#endif |
901 | 868 | size = rect.size; |
902 | 869 | scale = NSMakeSize(imagesize / size.width, imagesize / size.height); |
903 | 870 |
|
@@ -934,10 +901,8 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); } |
934 | 901 | rect.size.height = 0; |
935 | 902 | rect.origin.x += height; |
936 | 903 | NSTextView* messagebox = [[NSTextView alloc] initWithFrame: rect]; |
937 | | - if (@available(macOS 10.11, *)) { |
938 | | - messagebox.textContainer.maximumNumberOfLines = 2; |
939 | | - messagebox.textContainer.lineBreakMode = NSLineBreakByTruncatingTail; |
940 | | - } |
| 904 | + messagebox.textContainer.maximumNumberOfLines = 2; |
| 905 | + messagebox.textContainer.lineBreakMode = NSLineBreakByTruncatingTail; |
941 | 906 | [messagebox setFont: font]; |
942 | 907 | [messagebox setDrawsBackground: NO]; |
943 | 908 | [messagebox setSelectable: NO]; |
|
0 commit comments