Revision: 395 http://trac.macosforge.org/projects/ruby/changeset/395 Author: rich@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