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 | ae784be859b90900120790aa94073b4efee0d108 (patch) | |
tree | 5c176c3bf11bfab739306773b0791cf3e364cb10 /ext/tk/lib/multi-tk.rb | |
parent | 5c9e0e1bf84a5c71300b7b88ee6cf288cf916098 (diff) | |
download | ruby-ae784be859b90900120790aa94073b4efee0d108.tar.gz ruby-ae784be859b90900120790aa94073b4efee0d108.tar.xz ruby-ae784be859b90900120790aa94073b4efee0d108.zip |
* ext/tk/lib/multi-tk.rb: 'restart' method accepts arguments
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/multi-tk.rb')
-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 2a471ca01..7de36e1fb 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)}") |