From 9cd9b0d6d20776b537c709473052e95550ff8a08 Mon Sep 17 00:00:00 2001 From: "Steve Barnes (at Home" Date: Sun, 22 May 2016 08:56:27 +0100 Subject: [PATCH] Modified Treebook and Toolbook to use next(imageIdGenerator) rather than imageIdGenerator.next() --- demo/Toolbook.py | 8 ++++---- demo/Treebook.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demo/Toolbook.py b/demo/Toolbook.py index 96e1505b..4d6ce2fd 100644 --- a/demo/Toolbook.py +++ b/demo/Toolbook.py @@ -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" diff --git a/demo/Treebook.py b/demo/Treebook.py index c35bc44e..125742be 100644 --- a/demo/Treebook.py +++ b/demo/Treebook.py @@ -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)