Hello:
I am stuck on a problem that should be simple to
solve. I have a main frame with a notebook, which has
a scrolled window in one tab. On the scrolled window
are several wx.grids in a sizer. I programically
change (increase) the size of the grids due to a
button event, which increases the sizer around the
grids, but I can't get the main frame to increase in
size to fit it (i.e., so it uses its scroll bars).
Ive tried all sorts of combinations of statements,
like .Fit(), .Refresh(), .Layout(), and so on. Using
the following, I can force the main frame to increase
its size to the size of the BoxSizer, but then the
main frame no longer fits in the full window on the
computer screen:
Like I said, that does increase the window size but
not the right way. Any suggestions? This should be
simple, but Im not trying the right combination.
Thanks
John
···
____________________________________________________________________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more! http://tv.yahoo.com/collections/3658
From the looks of it, the problem is with the scrolled window. The size of the grids increases, but they are in a scrolled window that doesn't need to grow.
JJ wrote:
···
Hello:
I am stuck on a problem that should be simple to
solve. I have a main frame with a notebook, which has
a scrolled window in one tab. On the scrolled window
are several wx.grids in a sizer. I programically
change (increase) the size of the grids due to a
button event, which increases the sizer around the
grids, but I can't get the main frame to increase in
size to fit it (i.e., so it uses its scroll bars). Ive tried all sorts of combinations of statements,
like .Fit(), .Refresh(), .Layout(), and so on. Using
the following, I can force the main frame to increase
its size to the size of the BoxSizer, but then the
main frame no longer fits in the full window on the
computer screen:
Like I said, that does increase the window size but
not the right way. Any suggestions? This should be
simple, but Im not trying the right combination.
Thanks
John
____________________________________________________________________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more! Yahooist Teil der Yahoo Markenfamilie
Hello:
I am stuck on a problem that should be simple to
solve. I have a main frame with a notebook, which has
a scrolled window in one tab. On the scrolled window
are several wx.grids in a sizer. I programically
change (increase) the size of the grids due to a
button event, which increases the sizer around the
grids, but I can't get the main frame to increase in
size to fit it (i.e., so it uses its scroll bars).
I've had a somewhat similar problem with a frame containing a notebook, when one or more of the notebook's children resize themselves and I want the frame to enlarge or reduce accordingly. What I've found to work reasonably well is the following (which I think I got from Robin):
p = self
while p is not None:
p.Fit()
p = p.Parent
Do this after the "local" resizing in the notebook tab. The principle seems to be that "top-down" resizing will happen automatically when you use sizers, but you have to trigger "bottom-up" resizing yourself, with something like the above.