aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/lib/tk.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-23 12:01:24 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-23 12:01:24 +0000
commit4b87fa9de2b62d553f56671fef792a357d0996f7 (patch)
treea897541855c9884763588df981cc0a499cc8abdb /ext/tk/lib/tk.rb
parent29bcbe5c5e03fac304816862892375033f7d6dd9 (diff)
downloadruby-4b87fa9de2b62d553f56671fef792a357d0996f7.tar.gz
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.rb')
-rw-r--r--ext/tk/lib/tk.rb58
1 files changed, 57 insertions, 1 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 0d18882d8c..4afaaecf88 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -1921,6 +1921,62 @@ module Tk
end
end
+ def Tk.pkgconfig_list(mod)
+ # Tk8.5 feature
+ if mod.kind_of?(Module)
+ if mod.respond_to?(:package_name)
+ pkgname = mod.package_name
+ elsif mod.const_defined?(:PACKAGE_NAME)
+ pkgname = mod::PACKAGE_NAME
+ else
+ fail NotImplementedError, 'may not be a module for a Tcl extension'
+ end
+ else
+ pkgname = mod.to_s
+ end
+
+ pkgname = '::' << pkgname unless pkgname =~ /^::/
+
+ tk_split_list(tk_call(pkgname + '::pkgconfig', 'list'))
+ end
+
+ def Tk.pkgconfig_get(mod, key)
+ # Tk8.5 feature
+ if mod.kind_of?(Module)
+ if mod.respond_to?(:package_name)
+ pkgname = mod.package_name
+ else
+ fail NotImplementedError, 'may not be a module for a Tcl extension'
+ end
+ else
+ pkgname = mod.to_s
+ end
+
+ pkgname = '::' << pkgname unless pkgname =~ /^::/
+
+ tk_call(pkgname + '::pkgconfig', 'get', key)
+ end
+
+ def Tk.tcl_pkgconfig_list
+ # Tk8.5 feature
+ Tk.pkgconfig_list('::tcl')
+ end
+
+ def Tk.tcl_pkgconfig_get(key)
+ # Tk8.5 feature
+ Tk.pkgconfig_get('::tcl', key)
+ end
+
+ def Tk.tk_pkgconfig_list
+ # Tk8.5 feature
+ Tk.pkgconfig_list('::tk')
+ end
+
+ def Tk.tk_pkgconfig_get(key)
+ # Tk8.5 feature
+ Tk.pkgconfig_get('::tk', key)
+ end
+
def Tk.bell(nice = false)
if nice
tk_call_without_enc('bell', '-nice')
@@ -4499,7 +4555,7 @@ end
#Tk.freeze
module Tk
- RELEASE_DATE = '2005-11-19'.freeze
+ RELEASE_DATE = '2005-11-23'.freeze
autoload :AUTO_PATH, 'tk/variable'
autoload :TCL_PACKAGE_PATH, 'tk/variable'