how do I start PyCrust?

7stud bbxx789_05ss at yahoo.com
Sun Jun 10 17:50:47 PDT 2007


Thanks.  At first, I was a little confused by your various answers, but after
doing some tests, I think I figured out how they fit together.  If someone 
else stumbles upon this thread, the following is my understanding.  Please 
correct me if I got something wrong.

If any window(a frame, a panel, a button, etc. are all windows) has a single
child inside of it, then the child will expand to fill the window in response
to an EVT_SIZE event.  An EVT_SIZE event occurs when the window is initially
displayed or when you call SendSizeEvent().  

Also, since a sizer is not a window, a single child(like a panel) inserted
into a sizer won't automatically fill the sizer.  In fact, an empty panel
shrinks to size 0,0.

In the pycrust example, the frame was displayed on startup.  Subsequently,
adding a panel to the frame did not cause the panel to fill the frame because
no size event occurred *after* the panel was added to the frame.  Instead,
the added panel shrunk to size 0,0.  Calling SetBackgroundColour() and 
then calling Refresh() didn't work because the invisible panel was set to the
color blue and then the panel was refreshed to redraw that change on the 
panel, which meant that an invisible was redrawn in blue.

If you call SendSizeEvent() instead of Refresh(), then the panel will expand
to the size of the frame in response to EVT_SIZE, and the panel's blue color
will then be visible.






More information about the wxpython-users mailing list