lib/teacup/layout.rb in teacup-1.0.4 vs lib/teacup/layout.rb in teacup-1.2.2
- old
+ new
@@ -114,20 +114,26 @@
end
# prevents the calling of restyle! until we return to this method
should_restyle = Teacup.should_restyle_and_block
- unless view.stylesheet
- view.stylesheet = stylesheet
- end
+ # assign the 'teacup_next_responder', which is queried for a stylesheet if
+ # one is not explicitly assigned to the view
+ view.teacup_next_responder = self
view.stylename = name
if properties
view.style(properties) if properties
end
if block_given?
superview_chain << view
- instance_exec(view, &block) if block_given?
+ begin
+ instance_exec(view, &block) if block_given?
+ rescue NoMethodError => e
+ NSLog("Exception executing layout(#{view.inspect}) in #{self.inspect} (stylesheet=#{stylesheet})")
+ raise e
+ end
+
superview_chain.pop
end
if should_restyle
Teacup.should_restyle!