gFrame = new MyFrame( NULL, myframe_window_title, position, new_frame_size, app_style ); gSizer1 = new wxGridSizer(0, 2, 0, 0); wxPanel *m_Page1 = new wxPanel(gFrame, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); gSizer1->Add(m_Page1, 1, wxEXPAND , 5); wxPanel *m_panel2 = new wxPanel(gFrame, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); gSizer1->Add(m_panel2, 1, wxEXPAND , 5); gFrame->SetSizer(gSizer1); gFrame->Layout(); 

When increasing the size of the parent window, the child elements do not change their own, but only "smeared" as in the screenshot. enter image description here

  • When you try to resize the child panel manually, the application crashes right away. - Pavel Saenko
  • I can not consider myself a serious specialist in wx, but for a start I would suggest doing 2 things: 1) to make an event handler for the frame EVT_SIZE - this should do the correct redrawing of the window when resizing (and without the handler implementation there will be just such an effect as figure); 2) usually, when using wxSmith sizers (editor of windows from Code :: Blocks), after assigning the main window saser adds two more calls: gSizer1->Fit(this); gSizer1->SetSizeHints(this); gSizer1->Fit(this); gSizer1->SetSizeHints(this); - Vladimir
  • In any case, it will be useful to quote the minimum code to reproduce the error. - user227465

0