Merge pull request #939 from RobinD42/fix-issue888

Removed the wx.BookCtrlBase.RemovePage workaround
(cherry picked from commit 11cc4d5c25)
This commit is contained in:
Robin Dunn
2018-07-20 16:41:35 -07:00
parent cc940d3f30
commit 543fc796ab
3 changed files with 4 additions and 17 deletions

View File

@@ -69,6 +69,10 @@ Changes in this release include the following:
* Added wx.Treebook.GetTreeCtrl and wx.Choicebook.GetChoiceCtrl. (#918)
* Removed the wx.BookCtrlBase.RemovePage workaround as it was causing problems
and doesn't seem to be necessary any more. The wxWidgets assertions are catching
the out of range error just fine. (#888)

View File

@@ -13,8 +13,6 @@ class ColoredPanel(wx.Window):
def __init__(self, parent, color):
wx.Window.__init__(self, parent, -1, style = wx.SIMPLE_BORDER)
self.SetBackgroundColour(color)
if wx.Platform == '__WXGTK__':
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
#---------------------------------------------------------------------------

View File

@@ -42,21 +42,6 @@ def run():
c.find('HitTest.flags').out = True
# Workaround the lack of checking valid page numbers in wxGTK.
c.addPyCode("""\
def _checkBookPageCount(f):
import functools
@functools.wraps(f)
def wrapper(self, page):
if page >= self.GetPageCount():
raise wx.PyAssertionError("invalid notebook page")
return f(self, page)
return wrapper
BookCtrlBase.RemovePage = _checkBookPageCount(BookCtrlBase.RemovePage)
BookCtrlBase.GetPage = _checkBookPageCount(BookCtrlBase.GetPage)
""")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)