summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-14 04:34:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-14 04:34:43 +0000
commitce175376b2a0460d746270831d35240595cac276 (patch)
tree4db0e4a9b7f8a22513a4fd558425cb0fbaf5eb57 /ext
parent1ad26ccf354816b68273e0d9c82594fbcf009f29 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/lib/tk.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index b495a2e..4b1c21f 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -219,6 +219,17 @@ module TkComm
end
private :_get_eval_string
+ def ruby2tcl(v)
+ if v.kind_of?(Hash)
+ v = hash_kv(v)
+ v.flatten!
+ v.collect{|e|ruby2tcl(e)}
+ else
+ _get_eval_string(v)
+ end
+ end
+ private :ruby2tcl
+
Tk_IDs = [0, 0] # [0]-cmdid, [1]-winid
def _curr_cmd_id
id = format("c%.4d", Tk_IDs[0])
@@ -541,7 +552,7 @@ module TkCore
def tk_call(*args)
print args.join(" "), "\n" if $DEBUG
- args.collect! {|x|_get_eval_string(x)}
+ args.collect! {|x|ruby2tcl(x)}
args.compact!
args.flatten!
begin