]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/statbmp.mm
Fix item selection/focus drawing in generic wxListCtrl.
[wxWidgets.git] / src / cocoa / statbmp.mm
index 0be69ca515805a48b39d38d80df93cba6d64e3b9..3a050757c91667339988b4aa4ac708208a5d2ac3 100644 (file)
@@ -37,9 +37,12 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID winid,
     wxAutoNSAutoreleasePool pool;
     if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
         return false;
     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];
     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);
     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)
 {
 
 void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
 {
+    [GetNSImageView() setImage:bitmap.GetNSImage(true)];
+    m_bitmap = bitmap;
 }
 
 wxBitmap wxStaticBitmap::GetBitmap() const
 {
 }
 
 wxBitmap wxStaticBitmap::GetBitmap() const
 {
-    return wxNullBitmap;
+    return m_bitmap;
 }
 }