wxFrame
is a special case and is the only window which resizes its only child to entirely fill up its client area. Other windows, including wxPanel
, don't do this, so you do need to use a sizer -- or position the child panel manually in wxEVT_SIZE
handler.
Of course, if you think about it, it makes sense: while it's pretty common to have a wxPanel
entirely covering up the wxFrame
, it's very rare to have a wxPanel
or wxWindow
as the only child of another wxPanel
because it simply doesn't make any sense to do it, you're just wasting a window for nothing (and windows are a relatively heavy resource, so you shouldn't do this).