- if (!bitmap.Ok()) return NULL;
-
- wxToolBarTool *tool = new wxToolBarTool( this, toolIndex, bitmap, pushedBitmap, toggle,
- clientData, helpString1, helpString2 );
+ wxCHECK_MSG( bitmap.Ok(), (wxToolBarTool *)NULL,
+ "invalid bitmap for wxToolBar icon" );
+
+ wxToolBarTool *tool = new wxToolBarTool( this, toolIndex, bitmap, pushedBitmap,
+ toggle, clientData,
+ helpString1, helpString2 );
+
+ wxCHECK_MSG( bitmap.GetBitmap() == NULL, (wxToolBarTool *)NULL,
+ "wxToolBar doesn't support GdkBitmap" );
+
+ wxCHECK_MSG( bitmap.GetPixmap() != NULL, (wxToolBarTool *)NULL,
+ "wxToolBar::Add needs a wxBitmap" );