diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2023-09-27 15:45:05 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2023-09-27 15:45:05 +1000 |
commit | e1fe0a2bb0f5fc078f719198276757e4319e0e43 (patch) | |
tree | a0e846192c47440a787bc1f512dbc27071ffd806 /cocoa | |
parent | 2ce3269bf0331da6b23cfcc7d954dc7bad33518d (diff) | |
download | scintilla-mirror-e1fe0a2bb0f5fc078f719198276757e4319e0e43.tar.gz |
Deprecated methods disableFlushWindow and enableFlushWindow are avoided on
macOS 10.14+.
Test application contains example calls that exercize this when available.
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/ScintillaTest/AppController.mm | 4 | ||||
-rw-r--r-- | cocoa/ScintillaView.mm | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/cocoa/ScintillaTest/AppController.mm b/cocoa/ScintillaTest/AppController.mm index c835ba0de..9356ce1b8 100644 --- a/cocoa/ScintillaTest/AppController.mm +++ b/cocoa/ScintillaTest/AppController.mm @@ -116,6 +116,8 @@ const char user_keywords[] = // Definition of own keywords, not used by MySQL. } } + [mEditor suspendDrawing: TRUE]; + // Keywords to highlight. Indices are: // 0 - Major keywords (reserved keywords) // 1 - Normal keywords (everything not reserved but integral part of the language) @@ -219,6 +221,8 @@ const char user_keywords[] = // Definition of own keywords, not used by MySQL. // Uncomment if you wanna see auto wrapping in action. //[mEditor setGeneralProperty: SCI_SETWRAPMODE parameter: SC_WRAP_WORD value: 0]; + [mEditor suspendDrawing: FALSE]; + InfoBar* infoBar = [[[InfoBar alloc] initWithFrame: NSMakeRect(0, 0, 400, 0)] autorelease]; [infoBar setDisplay: IBShowAll]; [mEditor setInfoBar: infoBar top: NO]; diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 54988f650..cee96def5 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -1349,10 +1349,17 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { * (like clearing all marks and setting new ones etc.). */ - (void) suspendDrawing: (BOOL) suspend { - if (suspend) - [self.window disableFlushWindow]; - else - [self.window enableFlushWindow]; + if (@available(macOS 10.14, *)) { + // Don't try where deprecated + } else { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + if (suspend) + [self.window disableFlushWindow]; + else + [self.window enableFlushWindow]; +#pragma GCC diagnostic pop + } } //-------------------------------------------------------------------------------------------------- |