From: ts Date: 2002-05-14T02:25:57+09:00 Subject: Re: Tk callback with parameters >>>>> "K" == Kontra, Gergely writes: K> All the buttons should do basically the same task, just one parameter K> varies. So I'd like to ask if I can pass parameters to the callback K> function. (The value of the parameter is known, when I create the K> button. Well, I've not understood if you a proc you can give any parameter. Something like this require 'tk' $arg = ["aaa", "bbb"] def displ(a) puts a end TkButton.new() { text 'Dismiss' command proc{ displ($arg[0]) } }.pack('side'=>'left', 'expand'=>'yes') TkButton.new() { text 'Show' command proc { displ($arg[1]) } }.pack('side'=>'left', 'expand'=>'yes') Tk.mainloop Guy Decoux