From 3dbbe5a7857da3ebde58fa993d9e56ee04dc51a6 Mon Sep 17 00:00:00 2001 From: nagai Date: Tue, 25 Jan 2005 05:09:22 +0000 Subject: * ext/tcltklib/tcltklib.c: fix SEGV bug; trouble on canceling remained after scripts [ruby-dev:25479]: NULL current namespce when deleting Tk interpreter [ruby-talk:126225] * ext/tcltklib/extconf.rb: bug fix; TCL_ENABLE_THREAD flag is inverted [ruby-talk:126360] * ext/tcltklib/extconf.rb: add yet another native-thread check * ext/tk/tkutil.c: fix SEGV bug; NULL string pointer when finalize Ruby interpreter * ext/tk/lib/multi-tk.rb: avoid warning for deleted safeTk ip frame * ext/tk/lib/tk/bindtag.rb: bug fix; new method of named bindtag doesn't return the created object [ruby-dev:25479] * ext/tk/lib/tk/menu.rb: bug on treating arguments [ruby-dev:25479] * ext/tk/lib/tk.rb: bug fix; cannot accept a callback ID string for a command argument [ruby-dev:25479] * ext/tk/lib/multi-tk.rb: ditto * ext/tk/lib/tk/*.rb: ditto * ext/tk/lib/tkextlib/*.rb: ditto * ext/tk/sample/demos-jp/anilabel.rb: new demo script * ext/tk/sample/demos-en/anilabel.rb: ditto * ext/tk/sample/tkHTML/ss.rb: local variable scope bug fix [ruby-dev:25479] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/lib/multi-tk.rb | 18 +++++++++++++++--- ext/tk/lib/remote-tk.rb | 4 ++++ ext/tk/lib/tk.rb | 14 +++++++------- ext/tk/lib/tk/bindtag.rb | 1 + ext/tk/lib/tk/canvas.rb | 4 ++-- ext/tk/lib/tk/canvastag.rb | 4 ++-- ext/tk/lib/tk/menu.rb | 2 ++ ext/tk/lib/tk/text.rb | 4 ++-- ext/tk/lib/tk/texttag.rb | 4 ++-- ext/tk/lib/tkextlib/blt/component.rb | 4 ++-- ext/tk/lib/tkextlib/blt/tabset.rb | 8 ++++---- ext/tk/lib/tkextlib/blt/treeview.rb | 8 ++++---- ext/tk/lib/tkextlib/bwidget/labelentry.rb | 4 ++-- ext/tk/lib/tkextlib/bwidget/listbox.rb | 8 ++++---- ext/tk/lib/tkextlib/bwidget/notebook.rb | 4 ++-- ext/tk/lib/tkextlib/bwidget/spinbox.rb | 4 ++-- ext/tk/lib/tkextlib/bwidget/tree.rb | 8 ++++---- ext/tk/lib/tkextlib/itk/incr_tk.rb | 4 ++-- ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb | 4 ++-- ext/tk/lib/tkextlib/tkDND/tkdnd.rb | 4 ++-- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 4 ++-- 21 files changed, 69 insertions(+), 50 deletions(-) (limited to 'ext/tk/lib') diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index d292b5089..ef4868fde 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -762,7 +762,11 @@ class MultiTkIp #slave_ip.delete slave_ip._eval_without_enc('exit') end - top.destroy if top.winfo_exist? + begin + top.destroy if top.winfo_exist? + rescue + # ignore + end } tag = TkBindTag.new.bind('Destroy', slave_delete_proc) @@ -1560,10 +1564,14 @@ class << MultiTkIp __getip.delete end - def deleteed? + def deleted? __getip.deleted? end + def null_namespace? + __getip.null_namespace? + end + def abort(msg = nil) __getip.abort(msg) end @@ -1886,6 +1894,10 @@ class MultiTkIp @interp.deleted? end + def null_namespace? + @interp.null_namespace? + end + def abort(msg = nil) if master? if msg @@ -2217,7 +2229,7 @@ class MultiTkIp def set_bgerror_handler(cmd = Proc.new, slave = nil, &b) unless TkComm._callback_entry?(cmd) - unless slave + if !slave && b slave = cmd cmd = Proc.new(&b) end diff --git a/ext/tk/lib/remote-tk.rb b/ext/tk/lib/remote-tk.rb index 1ef5310bd..a2f8a46d4 100644 --- a/ext/tk/lib/remote-tk.rb +++ b/ext/tk/lib/remote-tk.rb @@ -282,6 +282,10 @@ class RemoteTkIp end end + def null_namespace? + false + end + def restart fail RuntimeError, 'cannot restart the remote interpreter' end diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 9dae5f089..7f734a082 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -913,7 +913,7 @@ module TkComm #end def bind(tagOrClass, context, *args) # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -928,7 +928,7 @@ module TkComm #end def bind_append(tagOrClass, context, *args) # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -952,7 +952,7 @@ module TkComm #end def bind_all(context, *args) # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -967,7 +967,7 @@ module TkComm #end def bind_append_all(context, *args) # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -2131,7 +2131,7 @@ module TkBindCore #end def bind(context, *args) # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -2144,7 +2144,7 @@ module TkBindCore #end def bind_append(context, *args) # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -3940,7 +3940,7 @@ end #Tk.freeze module Tk - RELEASE_DATE = '2004-12-27'.freeze + RELEASE_DATE = '2005-01-25'.freeze autoload :AUTO_PATH, 'tk/variable' autoload :TCL_PACKAGE_PATH, 'tk/variable' diff --git a/ext/tk/lib/tk/bindtag.rb b/ext/tk/lib/tk/bindtag.rb index 737223e3d..9023a08e0 100644 --- a/ext/tk/lib/tk/bindtag.rb +++ b/ext/tk/lib/tk/bindtag.rb @@ -23,6 +23,7 @@ class TkBindTag @id = name BTagID_TBL[@id] = self bind(*args, &b) if args != [] + self } end diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb index a0543cc42..e9a2caccd 100644 --- a/ext/tk/lib/tk/canvas.rb +++ b/ext/tk/lib/tk/canvas.rb @@ -100,7 +100,7 @@ class TkCanvas