diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-25 21:11:13 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-25 21:11:13 +0000 |
commit | 3f6f7a70e0a578f885ce1aa05b245a889e80f56b (patch) | |
tree | 00153801f2dde360c1f7c05c7a70fb68b765e091 /ext | |
parent | 19143c0e3d6a9ebb42a8ad9e59b6722f95f13f6a (diff) | |
download | ruby-3f6f7a70e0a578f885ce1aa05b245a889e80f56b.tar.gz ruby-3f6f7a70e0a578f885ce1aa05b245a889e80f56b.tar.xz ruby-3f6f7a70e0a578f885ce1aa05b245a889e80f56b.zip |
* ext/tk/lib/tk.rb: add shortcut-methods of tk_call + tk_split_list
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/tk/lib/tk.rb | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 1560f2a17..d6811b4e7 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1635,6 +1635,41 @@ module TkCore def tk_call_with_enc(*args) _tk_call_core(true, *args) end + + def _tk_call_to_list_core(depth, arg_enc, val_enc, *args) + args = _conv_args([], arg_enc, *args) + val = _tk_call_core(false, *args) + if !depth.kind_of?(Integer) || depth == 0 + tk_split_simplelist(val, false, val_enc) + else + tk_split_list(val, depth, false, val_enc) + end + end + #private :_tk_call_to_list_core + + def tk_call_to_list(*args) + _tk_call_to_list_core(-1, nil, true, *args) + end + + def tk_call_to_list_without_enc(*args) + _tk_call_to_list_core(-1, false, false, *args) + end + + def tk_call_to_list_with_enc(*args) + _tk_call_to_list_core(-1, true, true, *args) + end + + def tk_call_to_simplelist(*args) + _tk_call_to_list_core(0, nil, true, *args) + end + + def tk_call_to_simplelist_without_enc(*args) + _tk_call_to_list_core(0, false, false, *args) + end + + def tk_call_to_simplelist_with_enc(*args) + _tk_call_to_list_core(0, true, true, *args) + end end @@ -3391,6 +3426,25 @@ class TkObject<TkKernel end # private :tk_send, :tk_send_without_enc, :tk_send_with_enc + def tk_send_to_list(cmd, *rest) + tk_call_to_list(path, cmd, *rest) + end + def tk_send_to_list_without_enc(cmd, *rest) + tk_call_to_list_without_enc(path, cmd, *rest) + end + def tk_send_to_list_with_enc(cmd, *rest) + tk_call_to_list_with_enc(path, cmd, *rest) + end + def tk_send_to_simplelist(cmd, *rest) + tk_call_to_simplelist(path, cmd, *rest) + end + def tk_send_to_simplelist_without_enc(cmd, *rest) + tk_call_to_simplelist_without_enc(path, cmd, *rest) + end + def tk_send_to_simplelist_with_enc(cmd, *rest) + tk_call_to_simplelist_with_enc(path, cmd, *rest) + end + def method_missing(id, *args) name = id.id2name case args.length @@ -4076,7 +4130,7 @@ end #Tk.freeze module Tk - RELEASE_DATE = '2005-05-08'.freeze + RELEASE_DATE = '2005-05-26'.freeze autoload :AUTO_PATH, 'tk/variable' autoload :TCL_PACKAGE_PATH, 'tk/variable' |