summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ext/tk/lib/multi-tk.rb25
2 files changed, 23 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 81ea9c2..de866bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 30 22:40:30 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/multi-tk.rb: 'restart' method accepts arguments
+
Mon Aug 30 15:10:46 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in (GNU/k*BSD): fixed FTBFS on GNU/k*BSD. [ruby-dev:24051]
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index 2a471ca..7de36e1 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)}")