]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/richtext/richtext.cpp
removed dll export declaration for wxCStrData: it's unneeded because the class is...
[wxWidgets.git] / samples / richtext / richtext.cpp
index 2f0fb87c698a589e117ef6ebff4896dffb4ce8b0..e76ed01d8c483a975cea429cc42d47bbf83b4d9a 100644 (file)
@@ -333,6 +333,9 @@ IMPLEMENT_APP(MyApp)
 // 'Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
+    if ( !wxApp::OnInit() )
+        return false;
+
 #if wxUSE_HELP
     wxHelpProvider::Set(new wxSimpleHelpProvider);
 #endif
@@ -754,9 +757,12 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
     r.WriteText(wxT("colour, like this red bit."));
     r.EndTextColour();
 
-    r.BeginTextColour(wxColour(0, 0, 255));
-    r.WriteText(wxT(" And this blue bit."));
-    r.EndTextColour();
+    wxRichTextAttr backgroundColourAttr;
+    backgroundColourAttr.SetBackgroundColour(*wxGREEN);
+    backgroundColourAttr.SetTextColour(wxColour(0, 0, 255));
+    r.BeginStyle(backgroundColourAttr);
+    r.WriteText(wxT(" And this blue on green bit."));
+    r.EndStyle();
 
     r.WriteText(wxT(" Naturally you can make things "));
     r.BeginBold();