I really do not understand what's happening there.
I have a piece of code which is working fine:
Code: Select all
fgs = new wxFlexGridSizer(0,2,1,1);
fgs->AddGrowableCol(1);
fgs->Add( (new wxStaticText(page,wxID_ANY,wxT("Name :")))
//->SetFont(wxFont(16,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD))
);
fgs->Add( new wxStaticText(page,wxID_ANY,wxT("Test Failure")),1,wxEXPAND,0);
if(condition)
{
fgs->Add( (new wxStaticText(page,wxID_ANY,wxT("Level :")))
//->SetFont(wxFont(16,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL))
);
fgs->Add( new wxStaticText(page,wxID_ANY,wxT("Critical Failure")),1,wxEXPAND,0);
}
page->SetSizer(fgs);
page->Layout();
But if I uncomment the SetFont lines (specially the second), all concerned elements are appearing on top of each others at the case 0,0.
Can someone explain what is happening?