diff --git a/ChangeLog b/ChangeLog index 6a380d8aff..636e88483b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Nov 12 14:08:01 2004 Hidetoshi NAGAI + + * ext/tk/lib/tk/event.rb: remove $LOADED_FEATURES trick + + * ext/tk/lib/tk.rb: ditto + Thu Nov 11 17:58:19 2004 Yukihiro Matsumoto * dir.c (rb_glob): should have called rb_glob_caller(). diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index ea9f0749f5..6fb139f015 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1060,10 +1060,9 @@ module TkCore WIDGET_DESTROY_HOOK = '' INTERP._invoke_without_enc('event', 'add', - "<#{WIDGET_DESTROY_HOOK}>", 'Destroy') + "<#{WIDGET_DESTROY_HOOK}>", '') INTERP._invoke_without_enc('bind', 'all', "<#{WIDGET_DESTROY_HOOK}>", - install_bind(proc{|xpath| - path = xpath[1..-1] + install_cmd(proc{|path| unless TkCore::INTERP.deleted? if (widget = TkCore::INTERP.tk_windows[path]) if widget.respond_to?(:__destroy_hook__) @@ -1074,7 +1073,8 @@ module TkCore end end end - }, 'x%W')) + }) << ' %W') + INTERP.add_tk_procs(TclTkLib::FINALIZE_PROC_NAME, '', "bind all <#{WIDGET_DESTROY_HOOK}> {}") diff --git a/ext/tk/lib/tk/event.rb b/ext/tk/lib/tk/event.rb index 16adeedc6c..81d3e1c4c2 100644 --- a/ext/tk/lib/tk/event.rb +++ b/ext/tk/lib/tk/event.rb @@ -2,16 +2,15 @@ # tk/event.rb - module for event # -unless $LOADED_FEATURES.member?('tk.rb') - # change loading order +module TkEvent +end - $LOADED_FEATURES.delete('tk/event.rb') +######################## - require 'tkutil' - require 'tk' +require 'tkutil' +require 'tk' -else -################################################ +######################## module TkEvent class Event < TkUtil::CallbackSubst @@ -133,6 +132,8 @@ module TkEvent end + ############################################### + def install_bind_for_event_class(klass, cmd, *args) extra_args_tbl = klass._get_extra_args_tbl @@ -175,6 +176,3 @@ module TkEvent install_bind_for_event_class(TkEvent::Event, cmd, *args) end end - -################################################ -end