X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1af991f497a5e95d8f8ab15a4e4a4a4c375928f..866592d872daa1f4e3d44948d7d3a6c90b0af9d0:/src/gtk/bmpbuttn.cpp?ds=sidebyside diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index 7bfc477e35..b9226adabf 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -105,7 +105,7 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma // wxBitmapButton //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton) wxBitmapButton::wxBitmapButton() { @@ -118,13 +118,12 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi m_needParent = TRUE; m_acceptsFocus = TRUE; - wxSize newSize = size; - - PreCreation( parent, id, pos, newSize, style, name ); - -#if wxUSE_VALIDATORS - SetValidator( validator ); -#endif + if (!PreCreation( parent, pos, size ) || + !CreateBase( parent, id, pos, size, style, validator, name )) + { + wxFAIL_MSG( _T("wxBitmapButton creation failed") ); + return FALSE; + } m_bitmap = bitmap; m_disabled = bitmap; @@ -142,6 +141,8 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi if (m_bitmap.Ok()) { + wxSize newSize = size; + GdkBitmap *mask = (GdkBitmap *) NULL; if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap(); GtkWidget *pixmap = gtk_pixmap_new( m_bitmap.GetPixmap(), mask );