diff --git a/ChangeLog b/ChangeLog index 24bc254345..cf124a3a86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jul 14 13:08:13 2006 Hidetoshi NAGAI + + * 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 * lib/monitor.rb: document patch from Hugh Sasse . diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 499cfce927..eefe4b5556 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -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' diff --git a/ext/tk/lib/tk/namespace.rb b/ext/tk/lib/tk/namespace.rb index 35ea7a6b95..5bf6474c5b 100644 --- a/ext/tk/lib/tk/namespace.rb +++ b/ext/tk/lib/tk/namespace.rb @@ -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