diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-30 13:42:19 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-30 13:42:19 +0000 |
commit | e80e14c7882d3955eb88d078f43822af030a1bf4 (patch) | |
tree | 5c176c3bf11bfab739306773b0791cf3e364cb10 /ext/tk | |
parent | 6cd1907c58a14351413f99cfde078b19dcf9c756 (diff) | |
download | ruby-e80e14c7882d3955eb88d078f43822af030a1bf4.tar.gz |
* ext/tk/lib/multi-tk.rb: 'restart' method accepts arguments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/lib/multi-tk.rb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index 2a471ca01d..7de36e1fb5 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -994,7 +994,14 @@ class << MultiTkIp __getip.safe? end - def restart + def restart(app_name = nil, keys = {}) + init_ip_internal + + __getip._invoke('set', 'argv0', app_name) if app_name + if keys.kind_of?(Hash) + __getip._invoke('set', 'argv', _keys2opts(keys)) + end + __getip.restart end @@ -1127,8 +1134,8 @@ class << TclTkLib def get_eventloop_weight MultiTkIp.get_eventloop_weight end - def restart - MultiTkIp.restart + def restart(*args) + MultiTkIp.restart(*args) end def _merge_tklist(*args) @@ -1191,7 +1198,14 @@ class MultiTkIp @interp.deleted? end - def restart + def restart(app_name = nil, keys = {}) + _init_ip_internal(@@INIT_IP_ENV, @@ADD_TK_PROCS) + + @interp._invoke('set', 'argv0', app_name) if app_name + if keys.kind_of?(Hash) + @interp._invoke('set', 'argv', _keys2opts(keys)) + end + @interp.restart end @@ -1559,8 +1573,7 @@ class MultiTkIp # for '-nestedLoadOk' option ==> {nested=>true} if slot.kind_of?(Hash) ip = MultiTkIp.__getip - ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + - hash_kv(slot).join(' ')) + ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + _keys2opts(slot)) else ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + "-#{slot} #{_get_eval_string(value)}") |