lib/glimmer/dsl/tk/widget_expression.rb in glimmer-dsl-tk-0.0.30 vs lib/glimmer/dsl/tk/widget_expression.rb in glimmer-dsl-tk-0.0.31
- old
+ new
@@ -31,14 +31,18 @@
EXCLUDED_KEYWORDS = %w[root]
def can_interpret?(parent, keyword, *args, &block)
!EXCLUDED_KEYWORDS.include?(keyword) and
- parent.respond_to?(:tk) and
Glimmer::Tk::WidgetProxy.widget_exists?(keyword)
+ (parent.respond_to?(:tk) or args.first.respond_to?(:tk))
end
def interpret(parent, keyword, *args, &block)
+ if keyword == 'toplevel' && args.first.respond_to?(:tk)
+ parent = args.first
+ args[0] = args.first.tk
+ end
Glimmer::Tk::WidgetProxy.create(keyword, parent, args, &block)
end
def add_content(parent, keyword, *args, &block)
super