[wx-dev] How can I change text font for the notebook page?
Vadim Zeitlin
vadim at wxwindows.org
Tue Apr 3 04:32:16 PDT 2007
On Mon, 2 Apr 2007 21:53:09 -0400 (EDT) Igor Korot <ikorot at earthlink.net> wrote:
IK> Maybe somebody will give me an idea here....
IK>
IK> This is the code I'm using:
IK>
IK> if ( eventType == ei.typeChanged )
IK> {
IK> wxNotebookPage *pageCurrent = m_bookCtrl->GetPage(event.GetSelection());
IK> wxFont fontCurrent = pageCurrent->GetFont();
IK> fontCurrent.SetWeight( wxFONTWEIGHT_BOLD );
IK> pageCurrent->SetFont( fontCurrent );
IK> m_bookCtrl->SetPageText( event.GetSelection(), m_bookCtrl->GetPageText( event.GetSelection() ) );
IK> nameEvent = wxT("Changed");
IK> }
IK>
IK> This is from the "notebook" sample.
IK> However, text of the selected page does not change....
The above code sets the font for the page itself, i.e. for all controls
inside it but not for its label. This might be affected by wxNotebook own
font but I'm not sure if this currently works.
Regards,
VZ
More information about the wx-dev
mailing list