(In the actual application this peculiar nesting strategy makes
more sense -- this is just a minimal version.)On my machines, this program displays a Frame containing a
200x200 blue square, PLUS what looks like about 5 pixels of gray
border to the right, and 10 pixels of gray border at the bottom.If I add my 'bluepanel' with proportion=1 and flag=wx.EXPAND, the
border disappears, and the frame turns fully blue.My question is twofold: one, what is causing this border effect?
I don't *think* I'm doing anything forbidden, and I'd simply like
to understand why this is happening. And two, of course: is there
a way to get rid of the effect while retaining the fixed size for
my 'bluepanel' component?
1. I think it is because the size of the panel is less than the size of the frame, so you are seeing the frame's background colour in the areas that the panel isn't covering.
2. Use wx.EXPAND as you mentioned above, or, set the size of the panel and the size of the frame to be the same. So in the frame's __init__ and panel's __init__ put 'size=(x, y)', or set the size of the panel to be 'size=parent.GetSize()'.
At least, that's how I understand it. I can't see any reason for not wanting to use wx.EXPAND, that is what it's there for, to expand widges to a larger size.
Please correct me if I'm wrong.....
Cheers,
Jonathan