Hi.
When I was running my program, and click the button, it will show the
following message:
ArgumentError: wrong number of arguments (1 for 0)
You botched something or the API changed a bit since the samples were
made.
What line / in which method call? It’s hard to put the finger on this
without
that for people that don’t know Tk and SDL by heart without that.
Follow up after skimming the code a few times, by lucky coincidence, I
actually remember THAT much Tk…
DÅ?a Nedeľa 19 Február 2006 17:08 CFC napÃsal:
TkEntry.new(“textvariable”=>path).pack(“padx”=>10)
TkButton.new(){
text “Play”
command {proc Play(path.value, -1)}
IIRC, the #command method takes a Proc object as an argument, not a
block. The
above line should most probably be:
command(proc { Play(path.value, -1) })
You or someone else misplaced a curly brace, I added the parentheses for
clarity.
}.pack(“padx”=>10)
Tk.mainloop
(Why the heck is the #Play method in CamelCase anyway? Tsk-tsk-tsk, the
sample
author should get a lecture about naming conventions.)
IIRC, the #command method takes a Proc object as an argument, not a block. The
above line should most probably be:
command(proc { Play(path.value, -1) })
A block is available for #command method on current Ruby/Tk.
So,