Peter Damoc wrote:
All I want a simple window with a button on the bottom-right. The problem is the fact that the panel doesn't appear...(I made it red so I wouldn't miss it) 
What am I missing? where can I find more about the layout of components, about the relationship between wxPanel and the components that it holds and where do the sizers fit in all this mess?
A) When you post code, try to post a compete mini application, that way it's easy for us to test and modify your code.
B) Try not to use platfrom specific widgets (wxIEHTMLWin), so folks using other platfroms can help you
C) read:
http://wiki.wxpython.org/index.cgi/UsingSizers
and
http://wiki.wxpython.org/index.cgi/wxDesigner_20Sizer_20Tutorial
D) The very short version:
a wx.Panel is is a wx.Window that is used to hold collections of other controls. It is the parent of those controls and handles tab traversal, and probably other handy features.
a wx.Sizer is a object (NOT a wx.Window) that handles the sizing and positioning of controls. They are not the parents of controls, and they do not handle tab traversal or anything else.
E) As for your code:
1) I translated to the new style:
import wx
as that's what we all should be doing now.
2) I put a regular panel in, instead of a wxIEHtmlWin, as I am running Linux.
3) If you want just the wxIEHtmlWin and a button, you don't need another panel. If the plan is to put more buttons there, and have the panel have some use other than what it's doing here, then you probably want to put the button on the panel in a derived class, like your ColoredPanel.
4) You shouldn't need the ONSize handler, that should be covered by the SetSizer() call.
5) You use the wx.ALL flag, which spedcifies that you wqnt a border all the way around, but you didn't specify a border width
6) You havn't done any sizing of the button on the panel, so the panel is by default small, (20X20) on my system, but maybe even 0X0 on another, which may be why you don't see it.
Enclosed are two versions:
SimpleSizer.py : Just the panel and a button on the frame
SimpleSizer2.py: two panels on the frame, one with a button. This makes little sense if you have just the one button, but if you put multiple controls on it, it might.
-Chris
SimpleSizer.py (1022 Bytes)
SimpleSizer2.py (1.78 KB)
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov