And here is the relevant code, where I set the set size for the frame,
Code: Select all
void MainFrame::LoadConfigFile()
{
int height = 600, width = 800;
Settings settings(m_ConfigFilepath, m_DatabaseFilepath);
Serializer serialize(m_ConfigFilepath);
wxString font_face = serialize.DeserializeDisplaySettings().font_face;
int font_size = serialize.DeserializeDisplaySettings().font_size;
serialize.DeserializeBrowserControls("autoplay", bAutoplay);
serialize.DeserializeBrowserControls("loop", bLoop);
serialize.DeserializeBrowserControls("muted", bMuted);
height = serialize.DeserializeWinSize("Height", height);
width = serialize.DeserializeWinSize("Width", width);
settings.GetFontType().SetFaceName(font_face);
settings.GetFontType().SetPointSize(font_size);
this->SetFont(settings.GetFontType());
this->SetSize(width, height);
this->CenterOnScreen(wxBOTH);
this->SetIcon(wxIcon("../assets/icons/icon-hive_24x24.png", wxICON_DEFAULT_TYPE, -1, -1));
}
Code: Select all
MainFrame::MainFrame()
: wxFrame(NULL, wxID_ANY, "SampleHive", wxDefaultPosition),
m_ConfigFilepath("config.yaml"), m_DatabaseFilepath("sample.hive")
{
LoadConfigFile();
.
.
.
}