[macruby-changes] [395] MacRuby/trunk/lib/hotcocoa/mappings/text_field.rb

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 2 21:44:50 PDT 2008


Revision: 395
          http://trac.macosforge.org/projects/ruby/changeset/395
Author:   rich at infoether.com
Date:     2008-08-02 21:44:50 -0700 (Sat, 02 Aug 2008)
Log Message:
-----------
add text align

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

Modified: MacRuby/trunk/lib/hotcocoa/mappings/text_field.rb
===================================================================
--- MacRuby/trunk/lib/hotcocoa/mappings/text_field.rb	2008-08-03 04:43:55 UTC (rev 394)
+++ MacRuby/trunk/lib/hotcocoa/mappings/text_field.rb	2008-08-03 04:44:50 UTC (rev 395)
@@ -1,9 +1,23 @@
 HotCocoa::Mappings.map :text_field => :NSTextField do
+
+  constant :text_align, {
+    :right  => NSRightTextAlignment,
+    :left   => NSLeftTextAlignment,
+    :center => NSCenterTextAlignment
+  }
   
-  defaults :selectable => true, :editable => true, :layout => {}
+  defaults :selectable => true, :editable => true, :layout => {}, :frame => DefaultEmptyRect
   
   def init_with_options(text_field, options)
     text_field.initWithFrame options.delete(:frame)
   end
   
+  custom_methods do
+
+    def text_align=(value)
+      setAlignment(value)
+    end
+
+  end
+
 end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080802/a7b72be5/attachment.html 


More information about the macruby-changes mailing list