3
votes

I have quite a simple piece of code to set a three times bigger font for my wxFrame:

MainWin::MainWin()
       : wxFrame(NULL, wxID_ANY,wxEmptyString,
                 wxPoint(20,10), wxSize(1000, 600),
                 wxDEFAULT_FRAME_STYLE)
{
   wxFont font=GetFont();
   font=font.Scale(3.0);
   bool done=SetFont(font);

   wxMessageBox("test", "test", 5, this);

My problem: it does not work! Neither the wxMessageBox nor the title bar of the wxFrame nor any other children make use of this bigger font.

So...any idea what is wrong here?

Thanks!

1
The title bar is probably under control of the window manager. The wxMessageBox() does probably manage its own font styles. - Scheff's Cat
Concerning wxMessageBox(), I found Custom font for wxMessageBox in the wxWidgets Discussion Forum. It seems, there is no modifiable font at all for wxMessageBox(). - Scheff's Cat

1 Answers

5
votes

wxFrame font will be inherited by its (non-toplevel) children, so it's not completely useless to set it, but it won't be used neither for its title bar nor for any message boxes shown by it, as both of those use the system-defined font outside of the control of the application.