[Linux, wxGTK 2.1.15]
Am I misunderstanding something when I expect this codelet:
fooPan = wxPanel(self,-1,size=(40,40),pos=(50,25))
fooPan.SetBackgroundColour(wxBLUE)
(where self is a wxFrame) to give me a small blue panel inside the
larger frame? The reason I ask is that what I observe is a blue panel
filling the whole frame.
When a frame has only one child window (besides any *Bars) then it will
automatically resize it to fill the client area. If you don't like this
then you can catch EVT_SIZE and change how the child is sized and positioned
there.
The reason this all came up is I was trying to find the drawable area of
a wxFrame with a wxMenuBar and a wxStatusBar. I couldn't find any
straightforward way of doing this, so I figured I'd screw around by
putting a colored panel in the Frame and moving it around until I can
see the edges. Crude, yet it should work.
The client area is automatically offset by the size of the frame and
menubar, etc. so it starts at 0,0 and is GetClientSize() big. On the other
hand it is usually better to draw on a wxWindow or wxScrolledWindow and then
put it into the frame.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!