summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-10 09:52:30 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-10 09:52:30 +0000
commit6e0e4baf29ddfe8d3d4fb76b0dc1619abb5e5bef (patch)
tree05109d1d150a320fc59a389a4921be5a18a0d66c /ext/tk/lib/tk.rb
parent5ed246f1d37571ce482bf3fcbb28457d8dd5cf06 (diff)
* 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/branches/ruby_1_8@10505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk.rb')
-rw-r--r--ext/tk/lib/tk.rb32
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'