"Chris Barker" <Chris.Barker@noaa.gov> writes:
One possible source of some of your problems may be the use of wxWindow.
wxWindow is the base class for all wx controls, but is not generally
used by wxPython code directly. If you want a "box" to draw into, you
want a wxPanel.
With respect to sizers, the one behavior that wxWindow doesn't do by
default (but wxPanel does) is to call the sizer layout routine of any
attached sizer to the window. But if you add that support into your
wxWindow based class, it works just as well as a wxPanel with respect
to sizers. So just add something like:
def OnSize(self, event):
self.Layout()
and associate that with EVT_SIZE (or just add the Layout() call to an
existing EVT_SIZE handler).
You still need to call SetAutoLayout() and SetSizer() - since that's
what Layout() checks.
Of course, a wxPanel isn't a very high overhead compared to wxWindow
(it does the sizer, and also automatically enables tab traversal, but
I don't think a whole heck of a lot more). So using it can be just as
convenient.
-- David
/-----------------------------------------------------------------------\
\ David Bolen \ E-mail: db3l@fitlinxx.com /
> FitLinxx, Inc. \ Phone: (203) 708-5192 |
/ 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
\-----------------------------------------------------------------------/