diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-23 12:01:24 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-23 12:01:24 +0000 |
commit | 4b87fa9de2b62d553f56671fef792a357d0996f7 (patch) | |
tree | a897541855c9884763588df981cc0a499cc8abdb /ext/tk/lib/tk/virtevent.rb | |
parent | 29bcbe5c5e03fac304816862892375033f7d6dd9 (diff) |
Add lacks for Tk8.5 support.
* ext/tk/lib/tk.rb: add Tk.pkgconfig_list and Tk.pkgconfig_get [Tk8.5 feature].
* ext/tk/lib/tk/text.rb: supports new indices modifires on a Text widget
[Tk8.5 feature].
* ext/tk/lib/tk/virtevent.rb: add TkNamedVirtualEvent.
* ext/tk/lib/tk/autoload.rb: ditto.
* ext/tk/lib/tk/event.rb: add :data key for virtual events [Tk8.5 feature].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/virtevent.rb')
-rw-r--r-- | ext/tk/lib/tk/virtevent.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/tk/lib/tk/virtevent.rb b/ext/tk/lib/tk/virtevent.rb index a1a94d3c55..d47e80aecd 100644 --- a/ext/tk/lib/tk/virtevent.rb +++ b/ext/tk/lib/tk/virtevent.rb @@ -15,6 +15,19 @@ class TkVirtualEvent<TkObject TkCore::INTERP.init_ip_env{ TkVirtualEventTBL.clear } class PreDefVirtEvent<self + def self.new(event, *sequences) + if event =~ /^<(<.*>)>$/ + event = $1 + elsif event !~ /^<.*>$/ + event = '<' + event + '>' + end + if TkVirtualEvent::TkVirtualEventTBL.has_key?(event) + TkVirtualEvent::TkVirtualEventTBL[event] + else + super(event, *sequences) + end + end + def initialize(event, *sequences) @path = @id = event TkVirtualEvent::TkVirtualEventTBL[@id] = self @@ -89,3 +102,5 @@ class TkVirtualEvent<TkObject } end end + +TkNamedVirtualEvent = TkVirtualEvent::PreDefVirtEvent |