+ wxCHECK_MSG( bitmap.Ok(), false,
+ wxT("invalid bitmap for wxToolBar icon") );
+
+ wxCHECK_MSG( bitmap.GetDepth() != 1, false,
+ wxT("wxToolBar doesn't support GdkBitmap") );
+
+ wxCHECK_MSG( bitmap.GetPixmap() != NULL, false,
+ wxT("wxToolBar::Add needs a wxBitmap") );
+
+ GtkWidget *tool_pixmap = (GtkWidget *)NULL;
+
+
+ if (bitmap.HasPixbuf())
+ {
+ tool_pixmap = gtk_image_new();
+ tool->m_pixmap = tool_pixmap;
+ tool->SetPixmap(bitmap);
+ }
+ else
+ {
+ GdkPixmap *pixmap = bitmap.GetPixmap();
+
+ GdkBitmap *mask = (GdkBitmap *)NULL;
+ if ( bitmap.GetMask() )
+ mask = bitmap.GetMask()->GetBitmap();
+
+ tool_pixmap = gtk_pixmap_new( pixmap, mask );
+ gtk_pixmap_set_build_insensitive( GTK_PIXMAP(tool_pixmap), TRUE );
+ }
+
+ gtk_misc_set_alignment( GTK_MISC(tool_pixmap), 0.5, 0.5 );
+
+ tool->m_pixmap = tool_pixmap;
+ }