diff mac/dw.m @ 1719:032c3388dda6

Fix dw_window_set_bitmap_from_data() not using the resource ID if data is NULL. Also updated the readme file with recent changes and note an OS/2 bug.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 08 May 2012 18:53:03 +0000
parents c836c6c33d8e
children 2d44ca344863
line wrap: on
line diff
--- a/mac/dw.m	Tue May 08 18:28:39 2012 +0000
+++ b/mac/dw.m	Tue May 08 18:53:03 2012 +0000
@@ -8860,25 +8860,32 @@
     NSObject *object = handle;
     if([ object isKindOfClass:[ NSImageView class ] ])
     {
-        NSImageView *iv = handle;
-        NSData *thisdata = [NSData dataWithBytes:data length:len];
-        NSImage *pixmap = [[NSImage alloc] initWithData:thisdata];
-
-        if(pixmap)
-        {
-            [iv setImage:pixmap];
-        }
-        [pixmap release];
-        /* If we changed the text... */
-        Item *item = _box_item(handle);
-       
-        /* Check to see if any of the sizes need to be recalculated */
-        if(item && (item->origwidth == -1 || item->origheight == -1))
-        {
-            _control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);        
-            /* Queue a redraw on the top-level window */
-            _dw_redraw([iv window], TRUE);
-        }
+        if(data)
+        {
+            DW_LOCAL_POOL_IN;
+            NSImageView *iv = handle;
+            NSData *thisdata = [NSData dataWithBytes:data length:len];
+            NSImage *pixmap = [[NSImage alloc] initWithData:thisdata];
+            
+            if(pixmap)
+            {
+                [iv setImage:pixmap];
+            }
+            [pixmap release];
+            /* If we changed the text... */
+            Item *item = _box_item(handle);
+            
+            /* Check to see if any of the sizes need to be recalculated */
+            if(item && (item->origwidth == -1 || item->origheight == -1))
+            {
+                _control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);        
+                /* Queue a redraw on the top-level window */
+                _dw_redraw([iv window], TRUE);
+            }
+            DW_LOCAL_POOL_OUT;
+        }
+        else
+            dw_window_set_bitmap(handle, cid, NULL);
     }
 }