It seems that this is specific to windows, here is an example that reproduces the effect:
import wx
def makegrid(window):
grid = wx.GridSizer(24, 10, 1, 1)
window.SetSizer(grid)
for i in xrange(240):
cell = wx.Panel(window)
cell.SetBackgroundColour(wx.Color(i, i, i))
grid.Add(cell, flag=wx.EXPAND)
class TestFrame(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, parent)
makegrid(self)
class TestDialog(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent)
makegrid(self)
class Test(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None)
btn1 = wx.Button(self, label="Show Frame")
btn2 = wx.Button(self, label="Show Dialog")
sizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(sizer)
sizer.Add(btn1, flag=wx.EXPAND)
sizer.Add(btn2, flag=wx.EXPAND)
btn1.Bind(wx.EVT_BUTTON, self.OnShowFrame)
btn2.Bind(wx.EVT_BUTTON, self.OnShowDialog)
def OnShowFrame(self, event):
TestFrame(self).Show()
def OnShowDialog(self, event):
TestDialog(self).ShowModal()
app = wx.PySimpleApp()
app.TopWindow = Test()
app.TopWindow.Show()
app.MainLoop()
I have tried this on the following configurations:
- Windows 7 with Python 2.5.4 and wxPython 2.8.10.1
- Windows XP with Python 2.5.2 and wxPython 2.8.7.1
- Windows XP with Python 2.6.0 and wxPython 2.8.9.1
- Ubuntu 9.04 with Python 2.6.2 and wxPython 2.8.9.1
The wxDialog wasn't slow only on Ubuntu.