X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..0fe5e8fea017ecb73f8aaa8ceb745feb269b3f79:/src/motif/statbmp.cpp diff --git a/src/motif/statbmp.cpp b/src/motif/statbmp.cpp index 9d8c27fd00..49fe6c600a 100644 --- a/src/motif/statbmp.cpp +++ b/src/motif/statbmp.cpp @@ -13,6 +13,8 @@ #pragma implementation "statbmp.h" #endif +#include "wx/defs.h" + #include "wx/statbmp.h" #ifdef __VMS__ @@ -74,7 +76,13 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, ChangeFont(FALSE); SetCanAddEventHandler(TRUE); - AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); + + wxSize actualSize(size); + if (actualSize.x == -1) + actualSize.x = bitmap.GetWidth(); + if (actualSize.y == -1) + actualSize.y = bitmap.GetHeight(); + AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, actualSize.x, actualSize.y); ChangeBackgroundColour ();