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 | 2b2c7c36d18919fd2e948fac0f4faf57e681a62c (patch) | |
tree | b02e86a6b925a58ba0f9d3eed5ac4c4954da6eea /ext/tk | |
parent | 099672568175997a8576744f560cd087f468f4e1 (diff) |
* 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/branches/ruby_1_8@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 |