It's possible I missed a recent discussion of this, in which case I
apologize and please just point me to the appropriate place in the archive.
Also, I thought I remembered sending a query similar to this a couple of
weeks ago, but a check of my email reveals that we were having some of our
periodic problems at that point (Lotus notes is wonderful -- one of the
best information-hiding applications on the planet) and I don't think it
ever went out. So, hoping I haven't already posted this ...
I have a class subclassed off ScrolledPanel. The scrolled panel then
contains several other things in a sizer (static text, checkboxes, etc.).
I then place an instance of this inside a StaticBoxSizer sizer within my
frame. Everything works great *except* when I resize the window. The
scrolled panel just gets *completely* clobbered. If I minimize and
maximize, then it redisplays correctly. It looks like somebody isn't
sending or getting a resize event properly when you resize it dynamically
on the screen.
Here is the code where this happens:
ontologyPanel = OntologyPanel(self, -1, kbname, size = (150, 160))
self.ontologyProperties = ontologyPanel.ontologyProperties
ontologyNameList = self.ontologyProperties.keys()
ontoBox = wxStaticBox( self, -1, "Hierarchies" )
ontoBox.SetFont( wxFont( 8, wxSWISS, wxNORMAL, wxNORMAL ) )
ontoBoxSizer = wxStaticBoxSizer( ontoBox, wxVERTICAL )
ontoBoxSizer.AddWindow( ontologyPanel, 0, wxEXPAND|wxALIGN_RIGHT|wxALL, 5 )
topHsizer.AddSizer(ontoBoxSizer, 0, wxALIGN_RIGHT|wxALL, 5)
If I change the last line to
topHsizer.AddSizer(ontoBoxSizer, 1, wxALIGN_RIGHT|wxALL, 5)
then resizing works fine, but the static box is "too big". That is, it
doesn't conform to the (150, 160) size of the OntologyPanel but instead
extends to "fill up" space in its sizer -- leaving a bunch of empty space
within it. I must be missing something obvious here, but how can I get
resizing to work for the scrolled panel *and* have the static box be
minimally sized around that panel? If I use a wxPanel instead of a
wxScrolledPanel, I don't have this problem -- but I also don't have
scrolling!! What I want is for the scrolled panel to be sized as
specified, for the static box to appear around the panel without extra
space, and for resizing to work. I've tried a lot of different
combinations of parameters at this point and can't seem to find the key.
Any help will be appreciated.
···
--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456