我怎样才能使(它在-> -> ...wxGrid
之后继承)对象大小适合父大小?我尝试了方法,但它不起作用。
方法:wxScrollerWindow
wxWindows
wxPanel
Fit
OnInit
bool MyApp::OnInit()
{
wxFrame * win = new wxFrame(NULL, -1, _T("App"), wxPoint(300,300), wxSize(400,300), wxDEFAULT_FRAME_STYLE);
wxPanel * panel = new wxPanel(win, -1);
wxGrid * grid = new wxGrid(panel, -1, wxPoint(5,5), wxSize(300,200));
grid->SetDefaultColSize(120);
grid->SetDefaultRowSize(55);
grid->SetRowLabelSize(55);
grid->SetColLabelSize(25);
grid->CreateGrid(2,6,wxGrid::wxGridSelectCells);
grid->Fit();
win->Show();
return true;
}
MyApp
之后继承wxApp
。