Revision
621
Author
rich@infoether.com
Date
2008-09-24 23:11:13 -0700 (Wed, 24 Sep 2008)

Log Message

scaling image views

Modified Paths

Diff

Modified: MacRuby/trunk/lib/hotcocoa/mappings/image_view.rb (620 => 621)


--- MacRuby/trunk/lib/hotcocoa/mappings/image_view.rb	2008-09-25 04:30:37 UTC (rev 620)
+++ MacRuby/trunk/lib/hotcocoa/mappings/image_view.rb	2008-09-25 06:11:13 UTC (rev 621)
@@ -10,6 +10,12 @@
     :button => NSImageFrameButton
   }
   
+  constant :scale, {
+    :fit => NSScaleToFit,
+    :none => NSScaleNone,
+    :proportionally => NSScaleProportionally
+  }
+  
   def init_with_options(image_view, options)
     image_view.initWithFrame options.delete(:frame)
   end
@@ -28,6 +34,10 @@
       setImage(NSImage.alloc.initWithContentsOfFile(file))
     end
     
+    def scale=(value)
+      setImageScaling(value)
+    end
+    
   end
   
 end