Skip to content

Commit

Permalink
Merge pull request wxWidgets#939 from RobinD42/fix-issue888
Browse files Browse the repository at this point in the history
Removed the wx.BookCtrlBase.RemovePage workaround
(cherry picked from commit 11cc4d5)
  • Loading branch information
RobinD42 committed Jul 20, 2018
1 parent cc940d3 commit 543fc79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Expand Up @@ -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)




Expand Down
2 changes: 0 additions & 2 deletions demo/ColorPanel.py
Expand Up @@ -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)


#---------------------------------------------------------------------------
Expand Down
15 changes: 0 additions & 15 deletions etg/bookctrl.py
Expand Up @@ -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)
Expand Down

0 comments on commit 543fc79

Please sign in to comment.