]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dragimag/dragimag.cpp
include wx/arrstr.h as it's needed by wxImageHandler and may not be implicitly includ...
[wxWidgets.git] / samples / dragimag / dragimag.cpp
index 88881823a34183f4323706f0984ece348b210150..31b3f4c2e09497191b8af30d76a2f7b5da12096f 100644 (file)
@@ -385,15 +385,12 @@ bool MyApp::OnInit()
 
     wxString rootName(_T("shape0"));
 
-    int i;
-    for (i = 1; i < 4; i++)
+    for (int i = 1; i < 4; i++)
     {
-        wxString filename;
-        filename.Printf(wxT("%s%d.png"), (const wxChar*)rootName, i);
     /* For some reason under wxX11, the 2nd LoadFile in this loop fails, with
        a BadMatch inside CreateFromImage (inside ConvertToBitmap). This happens even if you copy
        the first file over the second file. */
-        if (image.LoadFile(filename, wxBITMAP_TYPE_PNG))
+        if (image.LoadFile(wxString::Format("%s%d.png", rootName, i), wxBITMAP_TYPE_PNG))
         {
             DragShape* newShape = new DragShape(wxBitmap(image));
             newShape->SetPosition(wxPoint(i*50, i*50));