Why is wxGridSizer much slower to initialize on a wxDialog then on a wxFrame?

10 views
Skip to first unread message

Toni Ruža

unread,
Jul 29, 2009, 12:50:37 AM7/29/09
to wxPytho...@googlegroups.com
It seems that this is specific to windows, attached is an example that reproduces the effect.

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.


This is also posted on http://stackoverflow.com/questions/1198067

example.py

Robin Dunn

unread,
Jul 29, 2009, 7:51:37 PM7/29/09
to wxPytho...@googlegroups.com
Toni Ruža wrote:
> It seems that this is specific to windows, attached is an example that
> reproduces the effect.
>
> 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.
>

This is really weird...

My guess is that this is due to Windows and wxWidgets not dealing very
well with overlapping siblings, and so when the sizer is doing the
initial layout and moving all the panels from (0,0) to where they need
to be that something about the dialog is causing all of them to be
refreshed and repainted at each move. If you instead do the initial
layout before the dialog is shown then it is just as fast as the frame.
You can do this by adding a call to window.Layout() at the end of
makegrid.

--
Robin Dunn
Software Craftsman
http://wxPython.org

Toni Ruža

unread,
Jul 30, 2009, 2:53:22 AM7/30/09
to wxPython-users
On Jul 30, 1:51 am, Robin Dunn <ro...@alldunn.com> wrote:
[...]
> You can do this by adding a call to window.Layout() at the end of
> makegrid.

Thanks
Reply all
Reply to author
Forward
0 new messages