]> git.saurik.com Git - wxWidgets.git/commitdiff
create image list of the right size to avoid asserts
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Sep 2003 18:58:39 +0000 (18:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Sep 2003 18:58:39 +0000 (18:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/controls/controls.cpp

index 52f3167fa9e938afa1dffca00f03ebc71ec77a33..5dc63aca099079beadb989557691e32da1de5fb2 100644 (file)
@@ -574,9 +574,11 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
     };
 
     // fill the image list
-    wxImageList *imagelist = new wxImageList(32, 32);
+    wxBitmap bmp(list_xpm);
 
-    imagelist-> Add( wxBitmap( list_xpm ));
+    wxImageList *imagelist = new wxImageList(bmp.GetWidth(), bmp.GetHeight());
+
+    imagelist-> Add( bmp );
     imagelist-> Add( wxBitmap( choice_xpm ));
     imagelist-> Add( wxBitmap( combo_xpm ));
     imagelist-> Add( wxBitmap( text_xpm ));