X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8eca4fef106b8327e2e55636de3f68a511a4c392..99109c0ff1c29c7c977c073f9f8e0bf4b8e728f7:/wxPython/demo/ColourDB.py diff --git a/wxPython/demo/ColourDB.py b/wxPython/demo/ColourDB.py index b3b08ce878..e00652c734 100644 --- a/wxPython/demo/ColourDB.py +++ b/wxPython/demo/ColourDB.py @@ -18,10 +18,6 @@ class TestWindow(wx.ScrolledWindow): #self.clrList.sort() self.bg_bmp = images.getGridBGBitmap() - # Event handlers - self.Bind(wx.EVT_PAINT, self.OnPaint) - self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) - # This could also be done by getting the window's default font; # either way, we need to have a font loaded for later on. #self.SetBackgroundColour("WHITE") @@ -54,6 +50,11 @@ class TestWindow(wx.ScrolledWindow): self.SetScrollbars( self.cellWidth, self.lineHeight, numCells, len(self.clrList) + 2 ) + + # Event handlers - moved here so events won't fire before init is + # finished. + self.Bind(wx.EVT_PAINT, self.OnPaint) + self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) # tile the background bitmap loaded in __init__()