lib/glimmer/dsl/tk/block_attribute_expression.rb in glimmer-dsl-tk-0.0.40 vs lib/glimmer/dsl/tk/block_attribute_expression.rb in glimmer-dsl-tk-0.0.41
- old
+ new
@@ -26,14 +26,18 @@
module Tk
class BlockAttributeExpression < Expression
def can_interpret?(parent, keyword, *args, &block)
block_given? and
args.size == 0 and
- parent.respond_to?("#{keyword}_block=")
+ (parent.respond_to?("#{keyword}_block=") || (parent.respond_to?(:tk) && parent.tk.respond_to?(keyword)))
end
def interpret(parent, keyword, *args, &block)
- parent.send("#{keyword}_block=", block)
+ if parent.respond_to?("#{keyword}_block=")
+ parent.send("#{keyword}_block=", block)
+ else
+ parent.tk.send(keyword, block)
+ end
nil
end
end
end
end