diff options
Diffstat (limited to 'ext/tk/lib/tk.rb')
-rw-r--r-- | ext/tk/lib/tk.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index d22f7b43d7..a2c4a7d61f 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -3911,7 +3911,7 @@ class TkRoot<TkWindow Tk_WINDOWS["."] = new end =end - def TkRoot.new(keys=nil) + def TkRoot.new(keys=nil, &b) unless TkCore::INTERP.tk_windows['.'] TkCore::INTERP.tk_windows['.'] = super(:without_creating=>true, :widgetname=>'.') @@ -3926,7 +3926,8 @@ class TkRoot<TkWindow end } end - return root + root.instance_eval(&b) if block_given? + root end WidgetClassName = 'Tk'.freeze |