From d062ab90e1d83bd53e7801ab9b7be82121bc628e Mon Sep 17 00:00:00 2001 From: nagai Date: Wed, 23 Nov 2005 12:01:24 +0000 Subject: 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/branches/ruby_1_8@9601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/lib/tk/autoload.rb | 1 + ext/tk/lib/tk/event.rb | 1 + ext/tk/lib/tk/text.rb | 92 ++++++++++++++++++++++++++++++++++++++++++++++ ext/tk/lib/tk/virtevent.rb | 15 ++++++++ 4 files changed, 109 insertions(+) (limited to 'ext/tk/lib/tk') diff --git a/ext/tk/lib/tk/autoload.rb b/ext/tk/lib/tk/autoload.rb index 73544e1d23..6b3773f4ea 100644 --- a/ext/tk/lib/tk/autoload.rb +++ b/ext/tk/lib/tk/autoload.rb @@ -162,6 +162,7 @@ autoload :TkVariable, 'tk/variable' autoload :TkVarAccess, 'tk/variable' autoload :TkVirtualEvent, 'tk/virtevent' +autoload :TkNamedVirtualEvent,'tk/virtevent' autoload :TkWinfo, 'tk/winfo' diff --git a/ext/tk/lib/tk/event.rb b/ext/tk/lib/tk/event.rb index b538bfd63d..af05dc96de 100644 --- a/ext/tk/lib/tk/event.rb +++ b/ext/tk/lib/tk/event.rb @@ -384,6 +384,7 @@ module TkEvent =end ALIAS_TBL = { :button => :num, + :data => :detail, :delta => :wheel_delta, :root => :rootwin_id, :rootx => :x_root, diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb index bd5de278cf..49d4b5625b 100644 --- a/ext/tk/lib/tk/text.rb +++ b/ext/tk/lib/tk/text.rb @@ -103,6 +103,58 @@ class TkText)>$/ + 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