From d7711acce373e98910dfc201b34b53f560425439 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 9 May 2022 21:49:11 -0700 Subject: [PATCH] Fix wrappers for platform-specific GTKSuppressDiagnostics and OSXEnableNewLineReplacement They need to be generated for all platforms, even if they do not do anything on some. --- etg/app.py | 8 +++++--- etg/textctrl.py | 11 ++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/etg/app.py b/etg/app.py index bd2ef2ae..d73ab011 100644 --- a/etg/app.py +++ b/etg/app.py @@ -10,7 +10,6 @@ import etgtools import etgtools.tweaker_tools as tools from etgtools import PyFunctionDef, PyCodeDef, PyPropertyDef -import sys PACKAGE = "wx" MODULE = "_core" @@ -207,8 +206,11 @@ def run(): c.addProperty('UseBestVisual GetUseBestVisual SetUseBestVisual') c.addProperty('TopWindow GetTopWindow SetTopWindow') - if sys.platform != 'linux': - c.find('GTKSuppressDiagnostics').ignore() + c.find('GTKSuppressDiagnostics').setCppCode("""\ + #ifdef __WXGTK__ + GTKSuppressDiagnostics(flags); + #endif + """) #------------------------------------------------------- diff --git a/etg/textctrl.py b/etg/textctrl.py index a590512e..af631a53 100644 --- a/etg/textctrl.py +++ b/etg/textctrl.py @@ -9,8 +9,6 @@ # License: wxWindows License #--------------------------------------------------------------------------- -import sys - import etgtools import etgtools.tweaker_tools as tools @@ -151,9 +149,12 @@ def parseAndTweakModule(): c.find('EnableProofCheck').ignore() c.find('GetProofCheckOptions').ignore() - # This function only exists on OSX - if sys.platform != 'darwin': - c.find('OSXEnableNewLineReplacement').ignore() + # This method exists only on OSX + c.find('OSXEnableNewLineReplacement').setCppCode("""\ + #ifdef __WXMAC__ + self->OSXEnableNewLineReplacement(enable); + #endif + """)