[macruby-changes] [505] MacRuby/trunk/sample-macruby/HotCocoa

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 27 22:22:24 PDT 2008


Revision: 505
          http://trac.macosforge.org/projects/ruby/changeset/505
Author:   rich at infoether.com
Date:     2008-08-27 22:22:23 -0700 (Wed, 27 Aug 2008)
Log Message:
-----------
remove these, use demo

Modified Paths:
--------------
    MacRuby/trunk/sample-macruby/HotCocoa/collection_view.rb

Removed Paths:
-------------
    MacRuby/trunk/sample-macruby/HotCocoa/combo_box.rb
    MacRuby/trunk/sample-macruby/HotCocoa/popup_action.rb
    MacRuby/trunk/sample-macruby/HotCocoa/secure_text_field.rb

Modified: MacRuby/trunk/sample-macruby/HotCocoa/collection_view.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/collection_view.rb	2008-08-28 05:21:56 UTC (rev 504)
+++ MacRuby/trunk/sample-macruby/HotCocoa/collection_view.rb	2008-08-28 05:22:23 UTC (rev 505)
@@ -3,11 +3,24 @@
 include HotCocoa
 
 class Icon
-  attr_accessor :name, :image
+  
+  ib_outlet :name, :image
+  
   def initialize(name, image)
     @name = name
+    puts "crea of #{object_id} - #{@name}"
     @image = image
   end
+  
+  def image
+    @image
+  end
+  
+  def name
+    puts "Name of #{object_id} - #{@name}"
+    @name
+  end
+  
 end
 
 class MyIconView < NSView
@@ -37,14 +50,17 @@
   end
   
 end
-
-icons = array_controller  :for => (1..100).collect { |i| Icon.new("Rich #{i}", image(:file => "rich.jpg")) },
+list = (1..5).collect { |i| Icon.new("Rich #{i}", image(:file => "rich.jpg"))}
+puts list.inspect
+icons = array_controller  :for => list ,
                           :avoids_empty_selection => true, 
                           :preserves_selection => false, 
                           :selects_inserted => false, 
                           :rearrange_automatically => true, 
                           :sort_by => {:name => :ascending}
                           
+puts icons.arrangedObjects.first.class
+                          
 application :name => "Collection View" do |app|
   window :frame => [100, 100, 500, 500], :title => "HotCocoa!" do |win|
     win << scroll_view(:layout => {:expand => [:width, :height]}) do |scroll|

Deleted: MacRuby/trunk/sample-macruby/HotCocoa/combo_box.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/combo_box.rb	2008-08-28 05:21:56 UTC (rev 504)
+++ MacRuby/trunk/sample-macruby/HotCocoa/combo_box.rb	2008-08-28 05:22:23 UTC (rev 505)
@@ -1,21 +0,0 @@
-require 'hotcocoa'
-
-include HotCocoa
-
-class Person < Struct.new(:first, :last)
-  def to_s
-    "#{first} #{last}"
-  end
-end
-people = [
-  Person.new("Rich", "Kilmer"),
-  Person.new("Chad", "Fowler"),
-  Person.new("Tom", "Copeland")
-]
-
-application :name => "Combo Box" do |app|
-  window :frame => [100, 100, 500, 500], :title => "HotCocoa!" do |win|
-    win << combo_box(:frame => [10, 10, 100, 25], :data => people)
-  end
-end
-

Deleted: MacRuby/trunk/sample-macruby/HotCocoa/popup_action.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/popup_action.rb	2008-08-28 05:21:56 UTC (rev 504)
+++ MacRuby/trunk/sample-macruby/HotCocoa/popup_action.rb	2008-08-28 05:22:23 UTC (rev 505)
@@ -1,23 +0,0 @@
-require 'hotcocoa'
-
-include HotCocoa
-
-sounds = Dir.glob("/System/Library/Sounds/*.aiff")
-
-application :name => "Popup Action" do |app|
-  window :frame => [200, 200, 300, 120], :title => "HotCocoa!" do |win|
-    win << button(:frame => [10, 80, 100, 25], :title => "Sounds!") do |b|
-      b.on_action do 
-        sound(:file => sounds[rand(sounds.size)]).play
-      end
-    end
-    win << popup(
-      :frame => [120, 80, 110, 25], 
-      :title => "Push Me!", 
-      :items => ["One", "Two", "Three"],
-      :on_action => Proc.new {|p| puts p.items.selected}
-    )
-  end
-end
-
-

Deleted: MacRuby/trunk/sample-macruby/HotCocoa/secure_text_field.rb
===================================================================
--- MacRuby/trunk/sample-macruby/HotCocoa/secure_text_field.rb	2008-08-28 05:21:56 UTC (rev 504)
+++ MacRuby/trunk/sample-macruby/HotCocoa/secure_text_field.rb	2008-08-28 05:22:23 UTC (rev 505)
@@ -1,9 +0,0 @@
-require 'hotcocoa'
-
-include HotCocoa
-
-application :name => "Secure Text Field" do |app|
-  window :frame => [200, 200, 300, 120], :title => "HotCocoa!" do |win|
-    win << secure_text_field(:echo => true, :frame => [20,20,200,20])
-  end
-end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080827/44f2f763/attachment.html 


More information about the macruby-changes mailing list