- wxNode *node = m_images.Nth( index );
- if (!node) return FALSE;
- wxBitmap *bm = (wxBitmap*)node->Data();
-
-#ifdef __WXGTK__
-
- // As X doesn't have a standard size for icons, we resize here.
- // Otherwise we'd simply have to forbid different bitmap sizes.
-
- if ((m_width != bm->GetWidth()) ||
- (m_height != bm->GetHeight()))
- {
- bm->Resize( m_width, m_height );
- };
-
-#endif
-
- wxIcon *icon = (wxIcon*)bm;
- dc.DrawIcon( *icon, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 );
-
- return TRUE;
-};
+ wxList::compatibility_iterator node = m_images.Item( index );
+
+ wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
+
+ wxBitmap *bm = (wxBitmap*)node->GetData();
+
+ if (bm->IsKindOf(CLASSINFO(wxIcon)))
+ dc.DrawIcon( * ((wxIcon*) bm), x, y);
+ else
+ dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 );
+
+ return TRUE;
+}