1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/tk/lib/tk.rb: add methods for new features of latest Tcl/Tk8.5

* ext/tk/lib/tk/namespace.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2006-07-14 04:10:51 +00:00
parent 58f761cf82
commit 89e1e19083
3 changed files with 40 additions and 4 deletions

View file

@ -1,3 +1,9 @@
Fri Jul 14 13:08:13 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: add methods for new features of latest Tcl/Tk8.5.
* ext/tk/lib/tk/namespace.rb: ditto.
Fri Jul 14 02:30:12 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/monitor.rb: document patch from Hugh Sasse <hgs at dmu.ac.uk>.

View file

@ -2357,15 +2357,15 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
end
def encoding_names
tk_split_simplelist(tk_call('encoding', 'names'))
TkComm.simplelist(Tk.tk_call('encoding', 'names'))
end
def encoding_system
tk_call('encoding', 'system')
Tk.tk_call('encoding', 'system')
end
def encoding_system=(enc)
tk_call('encoding', 'system', enc)
Tk.tk_call('encoding', 'system', enc)
end
def encoding_convertfrom(str, enc=nil)
@ -2389,6 +2389,16 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
ret
end
alias encoding_convert_to encoding_convertto
def encoding_dirs
# Tcl8.5 feature
TkComm.simplelist(Tk.tk_call_without_enc('encoding', 'dirs'))
end
def encoding_dirs=(dir_list) # an array or a Tcl's list string
# Tcl8.5 feature
Tk.tk_call_without_enc('encoding', 'dirs', dir_list)
end
end
extend Encoding
@ -2467,6 +2477,12 @@ else
str
end
alias encoding_convert_to encoding_convertto
def encoding_dirs
nil
end
def encoding_dirs=(dir_array)
nil
end
end
extend Encoding
@ -4581,7 +4597,7 @@ end
#Tk.freeze
module Tk
RELEASE_DATE = '2006-07-13'.freeze
RELEASE_DATE = '2006-07-14'.freeze
autoload :AUTO_PATH, 'tk/variable'
autoload :TCL_PACKAGE_PATH, 'tk/variable'

View file

@ -472,6 +472,20 @@ class TkNamespace < TkObject
tk_call('namespace', 'tail', str)
end
def self.upvar(namespace, *var_pairs)
tk_call('namespace', 'upvar', namespace, *(var_pairs.flatten))
end
def upvar(*var_pairs)
TkNamespace.inscope(@fullname, *(var_pairs.flatten))
end
def self.get_unknown_handler
tk_tcl2ruby(tk_call('namespace', 'unknown'))
end
def self.set_unknown_handler(cmd = Proc.new)
tk_call('namespace', 'unknown', cmd)
end
def self.which(name)
tk_call('namespace', 'which', name)
end