X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/338dd992160bf20205743c092b353d96ef7604fb..83b968da1a1e9c8b4e3965093629a6164a301378:/src/motif/statbmp.cpp diff --git a/src/motif/statbmp.cpp b/src/motif/statbmp.cpp index 32a9835b81..3d35638883 100644 --- a/src/motif/statbmp.cpp +++ b/src/motif/statbmp.cpp @@ -28,9 +28,7 @@ #include "wx/motif/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) -#endif /* * wxStaticBitmap @@ -76,7 +74,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 ();