X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c37dd6dad7f53b8f5f4c4a8d6434c2851cd2b9e4..8d5016b18bfaee2f1694e386a7dff89868a03b6d:/src/gtk/bmpbuttn.cpp diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index 5dcd049394..f6d2ee2e6e 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -16,4 +16,28 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton) +bool wxBitmapButton::Create(wxWindow *parent, + wxWindowID id, + const wxBitmap& bitmap, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) +{ + if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style, + validator, name) ) + return false; + + if ( bitmap.IsOk() ) + { + SetBitmapLabel(bitmap); + + // we need to adjust the size after setting the bitmap as it may be too + // big for the default button size + SetInitialSize(size); + } + + return true; +} #endif // wxUSE_BMPBUTTON