[macruby-changes] [355] MacRuby/trunk/lib/hotcocoa/layout_view.rb

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 10 09:36:21 PDT 2008


Revision: 355
          http://trac.macosforge.org/projects/ruby/changeset/355
Author:   rich at infoether.com
Date:     2008-07-10 09:36:21 -0700 (Thu, 10 Jul 2008)
Log Message:
-----------
add defaults_view in case you update the default options for a view, it will update its view

Modified Paths:
--------------
    MacRuby/trunk/lib/hotcocoa/layout_view.rb

Modified: MacRuby/trunk/lib/hotcocoa/layout_view.rb
===================================================================
--- MacRuby/trunk/lib/hotcocoa/layout_view.rb	2008-07-10 16:10:52 UTC (rev 354)
+++ MacRuby/trunk/lib/hotcocoa/layout_view.rb	2008-07-10 16:36:21 UTC (rev 355)
@@ -1,8 +1,9 @@
 module HotCocoa
 
 class LayoutOptions
-  attr_accessor :view
   
+  attr_accessor :view, :defaults_view
+  
   # options can be
   #
   #  :start -> bool
@@ -47,6 +48,7 @@
     @other = options[:other]
     @view = options[:view]
     update_view!
+    @defaults_view = options[:view]
   end
 
   def start=(value)
@@ -181,6 +183,7 @@
 
     def update_view!
       @view.views_updated! if in_layout_view?
+      @defaults_view.views_updated! if @defaults_view
     end
     
 end
@@ -215,12 +218,13 @@
   end
   
   def default_layout=(options)
+    options[:defaults_view] = self
     @default_layout = LayoutOptions.new(options)
     relayout!
   end
   
   def default_layout
-    @default_layout ||= LayoutOptions.new
+    @default_layout ||= LayoutOptions.new(:defaults_view => self)
   end
 
   def spacing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080710/6e735ffb/attachment.html 


More information about the macruby-changes mailing list