Fix the font pick buttons in the preferences dialog with wxGTK

wxGTK doesn't generate spin events when the value of a spin control is
set programmatically, so generate the event ourseleves.

Originally committed to SVN as r6323.
This commit is contained in:
Thomas Goyne 2012-01-20 15:14:41 +00:00
parent 2bc43eb886
commit 2e2d896ea9

View file

@ -95,7 +95,11 @@ static void font_button(Preferences *parent, wxTextCtrl *name, wxSpinCtrl *size)
font = wxGetFontFromUser(parent, font);
if (font.IsOk()) {
name->SetValue(font.GetFaceName());
size->SetValue(wxString::Format("%d", font.GetPointSize()));
size->SetValue(font.GetPointSize());
// wxGTK doesn't generate wxEVT_COMMAND_SPINCTRL_UPDATED from SetValue
wxSpinEvent evt(wxEVT_COMMAND_SPINCTRL_UPDATED);
evt.SetInt(font.GetPointSize());
size->ProcessWindowEvent(evt);
}
}