[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Some error for Tk.

zusocfc@gmail.com

2/19/2006 4:08:00 PM

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)

But, I have been read some samples..

and here is my code:

require 'tk'
require 'sdl'

def Play(path, times)
music=SDL::Mixer::Music.load(path)
SDL::Mixer.playMusic(music,-1)
end
SDL::init(SDL::INIT_AUDIO)
SDL::Mixer.open
path=TkVariable.new
TkEntry.new("textvariable"=>path).pack("padx"=>10)
TkButton.new(){
text "Play"
command {proc Play(path.value, -1)}
}.pack("padx"=>10)
Tk.mainloop

Does it have any error in the code?
Could anyone help me?
Thank you a lot.

3 Answers

David Vallner

2/19/2006 4:16:00 PM

0

Dna Nedela 19 Február 2006 17:08 CFC napísal:
> 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.

David Vallner


Hidetoshi NAGAI

2/20/2006 9:55:00 AM

0

zusocfc@gmail.com

3/8/2006 10:13:00 AM

0

Thanks a lot. :D
I've been solve this problem.
Thanks again!!