diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-10 09:52:30 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-10 09:52:30 +0000 |
commit | d2271cbdd18ea55851f21abd8862e5a3b6b98c9b (patch) | |
tree | a5b67350a63cf86c7f375ac60961514111817e07 /ext/tk/lib/tk.rb | |
parent | a1a07fbfa1c0263cf3e51eca2bf2907a917bde5c (diff) | |
download | ruby-d2271cbdd18ea55851f21abd8862e5a3b6b98c9b.tar.gz |
* ext/tk/tcltklib.c: make SEGV risk lower at exit.
* ext/tk/lib/tk.rb: ditto.
* ext/tk/lib/multi-tk.rb: fail to call function-style methods on slave
interpreters. The strategy (MultiTkIp_PseudoToplevel_Evaluable) to
fix the problem is a little tricky. You may have to take care of
conflicting with it.
* ext/tk/lib/tk.rb: a little change for the pseudo-toplevel strategy.
* ext/tk/lib/tk/font.rb: ditto.
* ext/tk/lib/tk/msgcat.rb: ditto.
* ext/tk/lib/tkextlib/itk/incr_tk.rb: ditto.
* ext/tk/sample/demos-en/widget: fail to call function-style methods
on sample scripts. To fix it, a strategy which similar to the way
on MultiTiIp is used. Please take care when re-write and re-run a
demo script on the Widget-Demo code viewer.
* ext/tk/sample/demos-jp/widget: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk.rb')
-rw-r--r-- | ext/tk/lib/tk.rb | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 4504d1d2ec..32360ac144 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1192,8 +1192,22 @@ module TkCore script.call(self) end def INTERP.add_tk_procs(name, args = nil, body = nil) - @add_tk_procs << [name, args, body] - self._invoke('proc', name, args, body) if args && body + if name.kind_of?(Array) + name.each{|param| self.add_tk_procs(*param)} + else + name = name.to_s + @add_tk_procs << [name, args, body] + self._invoke('proc', name, args, body) if args && body + end + end + def INTERP.remove_tk_procs(*names) + names.each{|name| + name = name.to_s + @add_tk_procs.delete_if{|elem| + elem.kind_of?(Array) && elem[0].to_s == name + } + self._invoke('rename', name, '') + } end def INTERP.init_ip_internal ip = self @@ -1285,6 +1299,8 @@ module TkCore EOL =end + at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) } + EventFlag = TclTkLib::EventFlag def callback_break @@ -3886,12 +3902,14 @@ class TkObject<TkKernel begin cget(name) rescue - fail NameError, - "undefined local variable or method `#{name}' for #{self.to_s}", - error_at + super(id, *args) +# fail NameError, +# "undefined local variable or method `#{name}' for #{self.to_s}", +# error_at end else - fail NameError, "undefined method `#{name}' for #{self.to_s}", error_at + super(id, *args) +# fail NameError, "undefined method `#{name}' for #{self.to_s}", error_at end end @@ -4563,7 +4581,7 @@ end #Tk.freeze module Tk - RELEASE_DATE = '2006-07-03'.freeze + RELEASE_DATE = '2006-07-10'.freeze autoload :AUTO_PATH, 'tk/variable' autoload :TCL_PACKAGE_PATH, 'tk/variable' |