[MacRuby-devel] [PATCH] NSTableColumn mappings for HotCocoa

Benjamin Stiglitz ben at tanjero.com
Wed Oct 8 08:02:38 PDT 2008


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


More information about the MacRuby-devel mailing list