X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e267406e113e2842201ca7049159c578d4988015..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/cocoa/statbmp.mm diff --git a/src/cocoa/statbmp.mm b/src/cocoa/statbmp.mm index 0be69ca515..3a050757c9 100644 --- a/src/cocoa/statbmp.mm +++ b/src/cocoa/statbmp.mm @@ -37,9 +37,12 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid, wxAutoNSAutoreleasePool pool; if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name)) return false; - m_cocoaNSView = NULL; SetNSView([[NSImageView alloc] initWithFrame: MakeDefaultNSRect(size)]); [m_cocoaNSView release]; + + [GetNSImageView() setImage:bitmap.GetNSImage(true)]; + m_bitmap = bitmap; + if(m_parent) m_parent->CocoaAddChild(this); SetInitialFrameRect(pos,size); @@ -57,9 +60,11 @@ void wxStaticBitmap::SetIcon(const wxIcon& icon) void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) { + [GetNSImageView() setImage:bitmap.GetNSImage(true)]; + m_bitmap = bitmap; } wxBitmap wxStaticBitmap::GetBitmap() const { - return wxNullBitmap; + return m_bitmap; }