永井@知能.九工大です.

From: Koji Arai <JCA02266 / nifty.ne.jp>
Subject: [ruby-dev:16189] Re: ruby 1.6.7 preview 1
Date: Mon, 4 Mar 2002 02:30:37 +0900
Message-ID: <20020304.021600.43125764.JCA02266 / nifty.ne.jp>
JCA02266> 以下だけ、適用できませんでしょうか?
JCA02266> というのも、今回 ruby -d で、tk に渡される引数を確かめてみよ
JCA02266> うとしたらあんまり役に立たなかったんです。

はい.
では,これに加えて,ややうっとおしい warning を消すようにしたパッチです.

diff -urN lib.orig/tk.rb lib/tk.rb
--- lib.orig/tk.rb	Fri Mar  1 23:12:05 2002
+++ lib/tk.rb	Mon Mar  4 11:05:21 2002
@@ -450,11 +450,11 @@
   end
 
   def pack(*args)
-    TkPack.configure *args
+    TkPack.configure(*args)
   end
 
   def grid(*args)
-    TkGrid.configure *args
+    TkGrid.configure(*args)
   end
 
   def update(idle=nil)
@@ -495,18 +495,18 @@
     myid = _curr_cmd_id
     cmdid = install_cmd(cmd)
     tk_call("after",ms,cmdid)
-    return
-    if false #defined? Thread
-      Thread.start do
-	ms = Float(ms)/1000
-	ms = 10 if ms == 0
-	sleep ms/1000
-	cmd.call
-      end
-    else
-      cmdid = install_cmd(cmd)
-      tk_call("after",ms,cmdid)
-    end
+#    return
+#    if false #defined? Thread
+#      Thread.start do
+#	ms = Float(ms)/1000
+#	ms = 10 if ms == 0
+#	sleep ms/1000
+#	cmd.call
+#      end
+#    else
+#      cmdid = install_cmd(cmd)
+#      tk_call("after",ms,cmdid)
+#    end
   end
 
   def after_idle(cmd=Proc.new)
@@ -657,10 +657,11 @@
   end
 
   def tk_call(*args)
-    print args.join(" "), "\n" if $DEBUG
+    puts args.inspect if $DEBUG
     args.collect! {|x|ruby2tcl(x)}
     args.compact!
     args.flatten!
+    print "=> ", args.join(" ").inspect, "\n" if $DEBUG
     begin
       res = INTERP._invoke(*args)
     rescue NameError
@@ -676,7 +677,7 @@
     if  INTERP._return_value() != 0
       fail RuntimeError, res, error_at
     end
-    print "==> ", res, "\n" if $DEBUG
+    print "==> ", res.inspect, "\n" if $DEBUG
     return res
   end
 end
@@ -836,8 +837,8 @@
       if bar
 	@xscrollbar = bar
 	@xscrollbar.orient 'horizontal'
-	self.xscrollcommand {|arg| @xscrollbar.set *arg}
-	@xscrollbar.command {|arg| self.xview *arg}
+	self.xscrollcommand {|arg| @xscrollbar.set(*arg)}
+	@xscrollbar.command {|arg| self.xview(*arg)}
       end
       @xscrollbar
     end
@@ -845,8 +846,8 @@
       if bar
 	@yscrollbar = bar
 	@yscrollbar.orient 'vertical'
-	self.yscrollcommand {|arg| @yscrollbar.set *arg}
-	@yscrollbar.command {|arg| self.yview *arg}
+	self.yscrollcommand {|arg| @yscrollbar.set(*arg)}
+	@yscrollbar.command {|arg| self.yview(*arg)}
       end
       @yscrollbar
     end
diff -urN lib.orig/tkfont.rb lib/tkfont.rb
--- lib.orig/tkfont.rb	Fri Mar  1 13:00:29 2002
+++ lib/tkfont.rb	Mon Mar  4 11:05:30 2002
@@ -776,7 +776,7 @@
 
   def call_font_configure(path, *args)
     args += hash_kv(args.pop.update(@fontslot))
-    tk_call *args
+    tk_call(*args)
     Tk_FontUseTBL[path] = self
     self
   end
diff -urN lib.orig/tktext.rb lib/tktext.rb
--- lib.orig/tktext.rb	Thu Feb 28 15:52:49 2002
+++ lib/tktext.rb	Mon Mar  4 11:06:22 2002
@@ -38,7 +38,7 @@
   def self.new(*args, &block)
     obj = super(*args){}
     obj.init_instance_variable
-    obj.instance_eval &block if defined? yield
+    obj.instance_eval(&block) if defined? yield
     obj
   end