-wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
- const wxBitmap& pushedBitmap, bool toggle,
- float WXUNUSED(xPos), float WXUNUSED(yPos), wxObject *clientData,
- const wxString& helpString1, const wxString& helpString2 )
-{
- if (!bitmap.Ok()) return NULL;
-
- wxToolBarTool *tool = new wxToolBarTool( this, toolIndex, bitmap, pushedBitmap, toggle,
- clientData, helpString1, helpString2 );
-
- GdkPixmap *pixmap = bitmap.GetPixmap();
-
- GdkBitmap *mask = NULL;
- if (bitmap.GetMask()) mask = bitmap.GetMask()->GetBitmap();
-
- GtkWidget *tool_pixmap = gtk_pixmap_new( pixmap, mask );
- gtk_misc_set_alignment( GTK_MISC(tool_pixmap), 0.5, 0.5 );
-
- GtkToolbarChildType ctype = GTK_TOOLBAR_CHILD_BUTTON;
- if (toggle) ctype = GTK_TOOLBAR_CHILD_TOGGLEBUTTON;
-
- gtk_toolbar_append_element( m_toolbar,
- ctype, NULL, NULL, helpString1, "", tool_pixmap, (GtkSignalFunc)gtk_toolbar_callback, (gpointer)tool );
-
- m_tools.Append( tool );
-
- return tool;
-};