X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fea5f26d46f7ee211f34908d82828133caaedb6..d1b736b7968ceea4233f3fceecdb01173f68a9a3:/samples/rotate/rotate.cpp diff --git a/samples/rotate/rotate.cpp b/samples/rotate/rotate.cpp index 7313f50ec8..5927f6e7b2 100644 --- a/samples/rotate/rotate.cpp +++ b/samples/rotate/rotate.cpp @@ -127,6 +127,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_LIBPNG wxImage::AddHandler( new wxPNGHandler ); #endif @@ -153,7 +156,7 @@ bool MyApp::OnInit() // ---------------------------------------------------------------------------- #include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(ArrayOfImages); +WX_DEFINE_OBJARRAY(ArrayOfImages) // ---------------------------------------------------------------------------- // custom canvas control that we can draw on @@ -213,7 +216,6 @@ void MyCanvas::OnPaint (wxPaintEvent &) size_t numImages = m_images.GetCount(); wxPaintDC dc(this); - dc.BeginDrawing(); dc.SetTextForeground(wxColour(255, 255, 255)); dc.DrawText(wxT("Click on the canvas to draw a duck."), 10, 10); @@ -222,8 +224,6 @@ void MyCanvas::OnPaint (wxPaintEvent &) MyRenderedImage & image = m_images.Item(i); dc.DrawBitmap(image.m_bmp, image.m_x, image.m_y, true); } - - dc.EndDrawing(); } // ----------------------------------------------------------------------------