I did a rewrite of the code (attached) in which I just gave the
scrolled panel a size
in its constructor, and kept the Fit() methods, and it seems fine now. Is
it OK to hard code an initial size just for this one panel?
> 2) Those buttons are supposed to be aligned to the right, and stay on the
> right as the window is resized. I have no idea why this isn't happening,
> but leaving out the scrolledpanel makes no difference, FWIW.
I think the problem was that you set wx.EXPAND and wx.ALIGN_RIGHT
at the same time...removing wx.EXPAND allowed it to work. Btw, you only
have to set ALIGN_RIGHT on the add of the btn_sizer, not on each button
itself; in other words, it is the whole sizer that is aligned to the right, not
the two individual buttons within that sizer.
> Any suggestions?
My edit of your code is attached. In addition to what I mentioned above,
I made a few changes as suggestions:
1. You didn't need a sizer on the frame itself--the first panel will
automatically
fill the frame. So I cut that.
2. I grouped like things together and used some blank lines/comments to
make it more readable (and one other suggestion).
4. Gave one of the panels a different color to help distinguish it easily.
HTH,
Che
> Sample app below. There are two problems:I did a rewrite of the code (attached) in which I just gave the
> 1) The inner scrolledpanel starts off with a size of (0,0). I could call
> SetMinSize, and in fact that's the workaround I ended up using in my app,
> and it doesn't stop the frame from being resized to less than the minimum
> panel size unless I call SetMinSize on the frame too. This ends up working,
> I guess, but it's messy.
scrolled panel a size
in its constructor, and kept the Fit() methods, and it seems fine now. Is
it OK to hard code an initial size just for this one panel?
> 2) Those buttons are supposed to be aligned to the right, and stay on theI think the problem was that you set wx.EXPAND and wx.ALIGN_RIGHT
> right as the window is resized. I have no idea why this isn't happening,
> but leaving out the scrolledpanel makes no difference, FWIW.
at the same time...removing wx.EXPAND allowed it to work. Btw, you only
have to set ALIGN_RIGHT on the add of the btn_sizer, not on each button
itself; in other words, it is the whole sizer that is aligned to the right, not
the two individual buttons within that sizer.
1. You didn't need a sizer on the frame itself--the first panel will
automatically fill the frame. So I cut that.