With marshmallows! Index: lib/hotcocoa/mappings/table_column.rb =================================================================== --- lib/hotcocoa/mappings/table_column.rb (revision 0) +++ lib/hotcocoa/mappings/table_column.rb (revision 0) @@ -0,0 +1,21 @@ +HotCocoa::Mappings.map :table_column => :NSTableColumn do + + defaults :title => 'Column' + + def init_with_options(table_column, options) + table_column.initWithIdentifier(options.delete(:identifier)) + end + + custom_methods do + + def title + headerCell.stringValue + end + + def title=(newTitle) + headerCell.stringValue = newTitle + end + + end + +end -Ben
Thanks for all these patches! I have applied your patches, and have switched column to have title/ title= instead of text= (I agree, its more consistent). I updated the sample too. Best, Rich On Oct 8, 2008, at 11:10 AM, Benjamin Stiglitz wrote:
With marshmallows!
My mistake, I didn’t see column.rb; name didn’t stand out to me. I happen to prefer the title accessor over text, which is usually only used in the context of NSTextViews, but it’s up to you.
-Ben _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
I have applied your patches, and have switched column to have title/ title= instead of text= (I agree, its more consistent). I updated the sample too.
Great—I forgot about that. I have some more mappings I’m working on, but I haven’t yet had time to clean them up. I’d also like to recast the TableDataSource in terms of bindings, but that’s a little more complex. -Ben
participants (2)
-
Benjamin Stiglitz
-
Richard Kilmer