# File tk/lib/tk/root.rb, line 91
def Root.destroy
TkCore::INTERP._invoke('destroy', '.')
end
# File tk/lib/tk/root.rb, line 18
def Root.new(keys=nil, &b)
unless TkCore::INTERP.tk_windows['.']
TkCore::INTERP.tk_windows['.'] =
super(:without_creating=>true, :widgetname=>'.'){}
end
root = TkCore::INTERP.tk_windows['.']
keys = _symbolkey2str(keys)
# wm commands
root.instance_eval{
__methodcall_optkeys.each{|key, method|
value = keys.delete(key.to_s)
self.__send__(method, value) if value
}
}
if keys # wm commands ( for backward compatibility )
keys.each{|k,v|
if v.kind_of? Array
root.__send__(k,*v)
else
root.__send__(k,v)
end
}
end
if block_given?
if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
root.instance_exec(root, &b)
else
root.instance_eval(&b)
end
end
root
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.