diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-01-25 05:09:22 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-01-25 05:09:22 +0000 |
commit | 10484e5c95d649554fc353012626c3696edd2eac (patch) | |
tree | 7497f0a182dae28c37d518d56551a8231092fc5c /ext/tk/lib | |
parent | 586d308ecf23a88d18413bd2ce9d1373e556c34f (diff) | |
download | ruby-10484e5c95d649554fc353012626c3696edd2eac.tar.gz |
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@7821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib')
-rw-r--r-- | ext/tk/lib/multi-tk.rb | 18 | ||||
-rw-r--r-- | ext/tk/lib/remote-tk.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tk.rb | 14 | ||||
-rw-r--r-- | ext/tk/lib/tk/bindtag.rb | 1 | ||||
-rw-r--r-- | ext/tk/lib/tk/canvas.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tk/canvastag.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tk/menu.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tk/text.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tk/texttag.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/component.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/tabset.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/blt/treeview.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/labelentry.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/listbox.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/notebook.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/spinbox.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/tree.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/itk/incr_tk.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tkDND/tkdnd.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 4 |
21 files changed, 69 insertions, 50 deletions
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index d292b5089d..ef4868fdef 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 1ef5310bde..a2f8a46d4e 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 9dae5f0899..7f734a0820 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 737223e3df..9023a08e06 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 a0543cc42d..e9a2caccd6 100644 --- a/ext/tk/lib/tk/canvas.rb +++ b/ext/tk/lib/tk/canvas.rb @@ -100,7 +100,7 @@ class TkCanvas<TkWindow #end def itembind(tag, 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 @@ -115,7 +115,7 @@ class TkCanvas<TkWindow #end def itembind_append(tag, 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 diff --git a/ext/tk/lib/tk/canvastag.rb b/ext/tk/lib/tk/canvastag.rb index 2eec6e3ca1..b1ac10ba43 100644 --- a/ext/tk/lib/tk/canvastag.rb +++ b/ext/tk/lib/tk/canvastag.rb @@ -27,7 +27,7 @@ module TkcTagAccess #end def bind(seq, *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 @@ -42,7 +42,7 @@ module TkcTagAccess #end def bind_append(seq, *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 diff --git a/ext/tk/lib/tk/menu.rb b/ext/tk/lib/tk/menu.rb index 8a33b482c7..e646d56246 100644 --- a/ext/tk/lib/tk/menu.rb +++ b/ext/tk/lib/tk/menu.rb @@ -438,6 +438,7 @@ class TkOptionMenubutton<TkMenubutton parent = nil if args[0].kind_of?(TkWindow) || args[0] == nil + keys.delete('parent') # ignore parent = args.shift else parent = keys.delete('parent') @@ -445,6 +446,7 @@ class TkOptionMenubutton<TkMenubutton @variable = nil if args[0].kind_of?(TkVariable) || args[0] == nil + keys.delete('variable') # ignore @variable = args.shift else @variable = keys.delete('variable') diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb index 8069adc57a..355153ea07 100644 --- a/ext/tk/lib/tk/text.rb +++ b/ext/tk/lib/tk/text.rb @@ -589,7 +589,7 @@ class TkText<TkTextWin #end def tag_bind(tag, seq, *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 @@ -604,7 +604,7 @@ class TkText<TkTextWin #end def tag_bind_append(tag, seq, *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 diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb index 1e3a2d7e41..6201c7caa8 100644 --- a/ext/tk/lib/tk/texttag.rb +++ b/ext/tk/lib/tk/texttag.rb @@ -173,7 +173,7 @@ class TkTextTag<TkObject #end def bind(seq, *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 @@ -188,7 +188,7 @@ class TkTextTag<TkObject #end def bind_append(seq, *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 diff --git a/ext/tk/lib/tkextlib/blt/component.rb b/ext/tk/lib/tkextlib/blt/component.rb index 417c1d454b..8e36946d0b 100644 --- a/ext/tk/lib/tkextlib/blt/component.rb +++ b/ext/tk/lib/tkextlib/blt/component.rb @@ -899,7 +899,7 @@ module Tk::BLT end def _component_bind(target, tag, context, *args) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -908,7 +908,7 @@ module Tk::BLT self end def _component_bind_append(target, tag, context, *args) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/blt/tabset.rb b/ext/tk/lib/tkextlib/blt/tabset.rb index 063460f163..693cce5073 100644 --- a/ext/tk/lib/tkextlib/blt/tabset.rb +++ b/ext/tk/lib/tkextlib/blt/tabset.rb @@ -78,7 +78,7 @@ module Tk::BLT #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 @@ -92,7 +92,7 @@ module Tk::BLT #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 @@ -243,7 +243,7 @@ module Tk::BLT #end def tabbind(tag, 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 @@ -257,7 +257,7 @@ module Tk::BLT #end def tabbind_append(tag, 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 diff --git a/ext/tk/lib/tkextlib/blt/treeview.rb b/ext/tk/lib/tkextlib/blt/treeview.rb index 8001472484..30ee528e7d 100644 --- a/ext/tk/lib/tkextlib/blt/treeview.rb +++ b/ext/tk/lib/tkextlib/blt/treeview.rb @@ -292,7 +292,7 @@ class Tk::BLT::Treeview end def tag_bind(tag, seq, *args) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -301,7 +301,7 @@ class Tk::BLT::Treeview self end def tag_bind_append(tag, seq, *args) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -323,7 +323,7 @@ class Tk::BLT::Treeview end def button_bind(tag, seq, *args) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new @@ -332,7 +332,7 @@ class Tk::BLT::Treeview self end def button_bind_append(tag, seq, *args) - if TkComm._callback_entry?(args[0]) + if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/bwidget/labelentry.rb b/ext/tk/lib/tkextlib/bwidget/labelentry.rb index 19e92d7ae4..dc1db06828 100644 --- a/ext/tk/lib/tkextlib/bwidget/labelentry.rb +++ b/ext/tk/lib/tkextlib/bwidget/labelentry.rb @@ -29,7 +29,7 @@ class Tk::BWidget::LabelEntry #end def entrybind(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 @@ -44,7 +44,7 @@ class Tk::BWidget::LabelEntry #end def entrybind_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 diff --git a/ext/tk/lib/tkextlib/bwidget/listbox.rb b/ext/tk/lib/tkextlib/bwidget/listbox.rb index 178866f699..3d26081e6c 100644 --- a/ext/tk/lib/tkextlib/bwidget/listbox.rb +++ b/ext/tk/lib/tkextlib/bwidget/listbox.rb @@ -50,7 +50,7 @@ class Tk::BWidget::ListBox #end def imagebind(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 @@ -66,7 +66,7 @@ class Tk::BWidget::ListBox #end def imagebind_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 @@ -91,7 +91,7 @@ class Tk::BWidget::ListBox #end def textbind(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 @@ -107,7 +107,7 @@ class Tk::BWidget::ListBox #end def textbind_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 diff --git a/ext/tk/lib/tkextlib/bwidget/notebook.rb b/ext/tk/lib/tkextlib/bwidget/notebook.rb index 01299d2de8..2bef13dffd 100644 --- a/ext/tk/lib/tkextlib/bwidget/notebook.rb +++ b/ext/tk/lib/tkextlib/bwidget/notebook.rb @@ -47,7 +47,7 @@ class Tk::BWidget::NoteBook #end def tabbind(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 @@ -63,7 +63,7 @@ class Tk::BWidget::NoteBook #end def tabbind_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 diff --git a/ext/tk/lib/tkextlib/bwidget/spinbox.rb b/ext/tk/lib/tkextlib/bwidget/spinbox.rb index 52dfa30abc..a5ddfafbf4 100644 --- a/ext/tk/lib/tkextlib/bwidget/spinbox.rb +++ b/ext/tk/lib/tkextlib/bwidget/spinbox.rb @@ -28,7 +28,7 @@ class Tk::BWidget::SpinBox #end def entrybind(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 @@ -43,7 +43,7 @@ class Tk::BWidget::SpinBox #end def entrybind_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 diff --git a/ext/tk/lib/tkextlib/bwidget/tree.rb b/ext/tk/lib/tkextlib/bwidget/tree.rb index dadf3d5161..5af9f0dc11 100644 --- a/ext/tk/lib/tkextlib/bwidget/tree.rb +++ b/ext/tk/lib/tkextlib/bwidget/tree.rb @@ -47,7 +47,7 @@ class Tk::BWidget::Tree #end def imagebind(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 @@ -63,7 +63,7 @@ class Tk::BWidget::Tree #end def imagebind_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 @@ -88,7 +88,7 @@ class Tk::BWidget::Tree #end def textbind(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 @@ -104,7 +104,7 @@ class Tk::BWidget::Tree #end def textbind_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 diff --git a/ext/tk/lib/tkextlib/itk/incr_tk.rb b/ext/tk/lib/tkextlib/itk/incr_tk.rb index 1d80e1cd6b..cdc05bde94 100644 --- a/ext/tk/lib/tkextlib/itk/incr_tk.rb +++ b/ext/tk/lib/tkextlib/itk/incr_tk.rb @@ -351,7 +351,7 @@ module Tk end end # 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 @@ -380,7 +380,7 @@ module Tk end end # 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 diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb index 939d97de67..d4b9b48fe0 100644 --- a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb +++ b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb @@ -103,7 +103,7 @@ class Tk::Iwidgets::Scrolledcanvas #end def itembind(tag, 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 @@ -118,7 +118,7 @@ class Tk::Iwidgets::Scrolledcanvas #end def itembind_append(tag, 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 diff --git a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb index 375ac89518..b75282d3c8 100644 --- a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb +++ b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb @@ -89,7 +89,7 @@ module Tk #end def dnd_bindtarget(type, event, *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 @@ -129,7 +129,7 @@ module Tk #end def dnd_bindsource(type, *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 diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb index 9c1e977d14..e5d58ef79d 100644 --- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb +++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb @@ -749,7 +749,7 @@ class Tk::TreeCtrl #end def notify_bind(obj, event, *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 @@ -764,7 +764,7 @@ class Tk::TreeCtrl #end def notify_bind_append(obj, event, *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 |