diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-12 05:09:37 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-12 05:09:37 +0000 |
commit | 47fa2caf2ec0ea135050d299d452331dd0d1a75d (patch) | |
tree | a7779fff9c865204b6f6d0cbe31b3982138e00a0 /ext/tk | |
parent | 9f3d5e71720dc450731ba6e50d589fd5c3c65757 (diff) | |
download | ruby-47fa2caf2ec0ea135050d299d452331dd0d1a75d.tar.gz |
* ext/tk/lib/tk/event.rb: remove $LOADED_FEATURES trick
* ext/tk/lib/tk.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/lib/tk.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tk/event.rb | 18 |
2 files changed, 12 insertions, 14 deletions
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 = '<WIDGET_DESTROY_HOOK>' INTERP._invoke_without_enc('event', 'add', - "<#{WIDGET_DESTROY_HOOK}>", 'Destroy') + "<#{WIDGET_DESTROY_HOOK}>", '<Destroy>') 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 |