[macruby-changes] [397] MacRuby/trunk/lib/hotcocoa/mappings/view.rb

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 2 21:45:37 PDT 2008


Revision: 397
          http://trac.macosforge.org/projects/ruby/changeset/397
Author:   rich at infoether.com
Date:     2008-08-02 21:45:37 -0700 (Sat, 02 Aug 2008)
Log Message:
-----------
add ability to create a view

Modified Paths:
--------------
    MacRuby/trunk/lib/hotcocoa/mappings/view.rb

Modified: MacRuby/trunk/lib/hotcocoa/mappings/view.rb
===================================================================
--- MacRuby/trunk/lib/hotcocoa/mappings/view.rb	2008-08-03 04:45:08 UTC (rev 396)
+++ MacRuby/trunk/lib/hotcocoa/mappings/view.rb	2008-08-03 04:45:37 UTC (rev 397)
@@ -1,6 +1,9 @@
 
 HotCocoa::Mappings.map :view => :NSView do
 
+  defaults :frame => DefaultEmptyRect,
+           :layout => {}
+
   constant :auto_resize, {
     :none   => NSViewNotSizable,
     :width  => NSViewWidthSizable,
@@ -10,13 +13,17 @@
     :max_x  => NSViewMaxXMargin,
     :max_y  => NSViewMaxYMargin
   }
-
+  
   constant :border, {
     :none           => NSNoBorder,
     :line           => NSLineBorder,
     :bezel          => NSBezelBorder,
     :groove         => NSGrooveBorder
   }
+
+  def init_with_options(view, options)
+    view.initWithFrame options.delete(:frame)
+  end
   
   custom_methods do
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080802/e51f046f/attachment.html 


More information about the macruby-changes mailing list