summaryrefslogtreecommitdiff
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
commitd062ab90e1d83bd53e7801ab9b7be82121bc628e (patch)
tree2a765634d3576fc61ed54278059a1268bc6ebf79 /ext/tk/lib/tk.rb
parentce4cda9de58a01dd1202222a5349064641f311f3 (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/branches/ruby_1_8@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'