#16088: best size is not updated after SetFont() with GTK >= 3.6
---------------------+----------------------
Reporter: pcor | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: wxGTK | Version:
Resolution: | Keywords: gtk3
Blocked By: | Blocking:
Patch: 0 |
---------------------+----------------------
Changes (by jpo234):
* cc: jpo234@… (removed)
Comment:
It's still broken for the following test case:
{{{
#include <wx/wx.h>
#include <wx/simplebook.h>
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
class MyFrame : public wxFrame
{
protected:
wxSimplebook* m_simplebook1;
wxPanel* m_panel1;
wxStaticText* m_staticText1;
wxPanel* m_panel2;
wxStaticText* m_staticText2;
wxButton* m_button1;
int m_book_page;
// Virtual event handlers, overide them in your derived class
virtual void OnButtonClick(wxCommandEvent& event) {
m_book_page = (m_book_page == 0) ? 1 : 0;
m_simplebook1->ChangeSelection(m_book_page);
}
public:
MyFrame(const wxString& title, const wxPoint& pos, const wxSize&
size);
};
wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
MyFrame* frame = new MyFrame("Hello World", wxPoint(50, 50),
wxSize(450, 340));
frame->Show(true);
return true;
}
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize&
size)
: wxFrame(NULL, wxID_ANY, title, pos, size)
{
this->SetSizeHints(wxDefaultSize, wxDefaultSize);
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer(wxVERTICAL);
m_simplebook1 = new wxSimplebook(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize, 0);
m_panel1 = new wxPanel(m_simplebook1, wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxTAB_TRAVERSAL);
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer(wxVERTICAL);
m_staticText1 = new wxStaticText(m_panel1, wxID_ANY, wxT("Panel
1"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText1->Wrap(-1);
m_staticText1->SetFont(wxFont(15, wxFONTFAMILY_DEFAULT,
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString));
bSizer2->Add(m_staticText1, 0, wxALL, 5);
m_panel1->SetSizer(bSizer2);
m_simplebook1->AddPage(m_panel1, wxT("a page"), false);
m_panel2 = new wxPanel(m_simplebook1, wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxTAB_TRAVERSAL);
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer(wxVERTICAL);
m_staticText2 = new wxStaticText(m_panel2, wxID_ANY, wxT("Panel
2"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText2->Wrap(-1);
m_staticText2->SetFont(wxFont(30, wxFONTFAMILY_DEFAULT,
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString));
bSizer3->Add(m_staticText2, 0, wxALL, 5);
m_panel2->SetSizer(bSizer3);
m_simplebook1->AddPage(m_panel2, wxT("a page"), false);
bSizer1->Add(m_simplebook1, 1, wxEXPAND | wxALL, 5);
m_button1 = new wxButton(this, wxID_ANY, wxT("Switch"),
wxDefaultPosition, wxDefaultSize, 0);
bSizer1->Add(m_button1, 0, wxALL, 5);
this->SetSizer(bSizer1);
this->Centre(wxBOTH);
// Connect Events
m_button1->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(MyFrame::OnButtonClick), NULL, this);
m_book_page = m_simplebook1->GetSelection();
}
}}}
--
Ticket URL: <
https://trac.wxwidgets.org/ticket/16088#comment:13>