Add ResetLocale

This commit is contained in:
Robin Dunn
2019-10-16 11:38:49 -07:00
parent 224d62104a
commit 382a624aaf

View File

@@ -510,8 +510,8 @@ def run():
Try to ensure that the C and Python locale is in sync with wxWidgets locale.
""",
body="""\
self.ResetLocale()
import locale
self._initial_locale = None
loc, enc = locale.getlocale()
# Try to set it to the same language as what is already set in the C locale
info = wx.Locale.FindLanguageInfo(loc) if loc else None
@@ -522,6 +522,15 @@ def run():
self._initial_locale = wx.Locale(wx.LANGUAGE_DEFAULT)
"""),
PyFunctionDef('ResetLocale', '(self)',
doc="""\
Release the wx.Locale object created in :meth:`InitLocale`.
This will reset the application's locale to the previous settings.
""",
body="""\
self._initial_locale = None
"""),
PyFunctionDef('Get', '()', isStatic=True,
doc="""\
A staticmethod returning the currently active application object.
@@ -532,7 +541,6 @@ def run():
module.addPyClass('PySimpleApp', ['App'], deprecated="Use :class:`App` instead.",
doc="""This class is deprecated. Please use :class:`App` instead.""",
items=[