Modified Treebook and Toolbook to use next(imageIdGenerator) rather than imageIdGenerator.next()

This commit is contained in:
Steve Barnes (at Home
2016-05-22 08:56:27 +01:00
parent c1ca8af72a
commit 9cd9b0d6d2
2 changed files with 6 additions and 6 deletions

View File

@@ -19,8 +19,8 @@ def getNextImageID(count):
imID += 1
if imID == count:
imID = 0
class TestTB(wx.Toolbook):
def __init__(self, parent, id, log):
wx.Toolbook.__init__(self, parent, id, style=
@@ -40,12 +40,12 @@ class TestTB(wx.Toolbook):
il.Add(bmp)
self.AssignImageList(il)
imageIdGenerator = getNextImageID(il.GetImageCount())
# Now make a bunch of panels for the list book
first = True
for colour in colourList:
win = self.makeColorPanel(colour)
self.AddPage(win, colour, imageId=imageIdGenerator.next())
self.AddPage(win, colour, imageId=next(imageIdGenerator))
if first:
st = wx.StaticText(win.win, -1,
"You can put nearly any type of window here,\n"

View File

@@ -45,7 +45,7 @@ class TestTB(wx.Treebook):
first = True
for colour in colourList:
win = self.makeColorPanel(colour)
self.AddPage(win, colour, imageId=imageIdGenerator.next())
self.AddPage(win, colour, imageId=next(imageIdGenerator))
if first:
st = wx.StaticText(win.win, -1,
"You can put nearly any type of window here,\n"
@@ -56,7 +56,7 @@ class TestTB(wx.Treebook):
win = self.makeColorPanel(colour)
st = wx.StaticText(win.win, -1, "this is a sub-page", (10,10))
self.AddSubPage(win, 'a sub-page', imageId=imageIdGenerator.next())
self.AddSubPage(win, 'a sub-page', imageId=next(imageIdGenerator))
self.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.OnPageChanged)
self.Bind(wx.EVT_TREEBOOK_PAGE_CHANGING, self.OnPageChanging)