Performance: Sizer vs. Panel

Ok, I made a small sample of my month-view...

I've cleaned the code from needless and awkward things, so the performance is a little better.

But I'm still not sure whether the way I make a month-view is far too complicated.

I would be happy for comments from you.

Thanks a lot.

Claus Gaisser

> Of course I'd seen the Grid samples... That is why I believe, seperate
> Panels for each day in contrast to Gridcells are more flexible in
> layout (for example scrolled Panels, free positioning of Text,
> integration of controlwidgets...)
> I also think, with a Day(wx.Panel)-class it is easier to make several
> views (week, month, day)...
> But I must confess, I haven't really looked on the possibilities of
> wx.Grid. Perhaps with Gridcells I can realize as much as with Panels.
> I'll check it out.

I wasn't suggesting that you use Grid itself, that would probably not be
a very good choice. I was suggesting that like the Grid you self-draw
the calendar content on a single (or maybe a few) widget(s) instead of
using hundreds of independent widgets.
> Are my deliberations completely stupid??

No, but in order to help you get better performance of your current
solution we'll probably need you to duplicate it in a small-as-possible
runnable sample that we can experiment with.
http://wiki.wxpython.org/MakingSampleApps <http://www.google.com/url?sa=D&q=http://wiki.wxpython.org/MakingSampleApps&usg=AFQjCNHMh3B1-PGzTMDhyBFl38Fl5Et1JA>

Kalender.py (29.2 KB)

···

On 2/7/10 5:16 AM, Claus Gaisser wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org <http://www.google.com/url?sa=D&q=http://wxPython.org&usg=AFQjCNGoZsaL9Nk038esmNWGmDL78Emn0Q>

After seeing it I can only reiterate that drawing the calendar yourself in a single window would be better than using hundreds of windows. It's the difference between 1 medium complex paint event handler plus one size event handler vs. hundreds of simple paint events plus hundreds of size events plus dozens of layouts.

···

On 2/10/10 1:51 AM, Claus Gaisser wrote:

Ok, I made a small sample of my month-view...

I've cleaned the code from needless and awkward things, so the
performance is a little better.

But I'm still not sure whether the way I make a month-view is far too
complicated.

I would be happy for comments from you.

--
Robin Dunn
Software Craftsman

Thank you for your help!

This makes sense to me. Furthermore the InspectionTool helps me better understand, what happens behind the scenes...

I thought, I do not have to paint every day by myself, cause a panel make all that stuff for me. But I want to understand much more about the things that not to see on screen... :slight_smile:

Claus Gaisser

Robin Dunn schrieb:

···

On 2/10/10 1:51 AM, Claus Gaisser wrote:

Ok, I made a small sample of my month-view...

I've cleaned the code from needless and awkward things, so the
performance is a little better.

But I'm still not sure whether the way I make a month-view is far too
complicated.

I would be happy for comments from you.

After seeing it I can only reiterate that drawing the calendar yourself in a single window would be better than using hundreds of windows. It's the difference between 1 medium complex paint event handler plus one size event handler vs. hundreds of simple paint events plus hundreds of size events plus dozens of layouts.