From: Jeppe Jakobsen Date: 2006-04-12T06:41:39+09:00 Subject: Q about tk buttons ------=_Part_17650_2550911.1144791696845 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi guys, I have a little problem with the buttons in tk. I want to add 1 to a variable when pushing a button but tk won't let me. Here some of my code: require "tk" var =3D TkVariable.new(0) #defining variable var +=3D 1 #making it a fixnum and adding 1 root =3D TkRoot.new() label =3D TkLabel.new(:text=3D> var).pack() button =3D TkButton.new(:text=3D> "Button", :command=3D>proc{var +=3D 1}).p= ack() Tk.mainloop Why can I use var +=3D 1 outside of the button, when I can't use it inside = it. Please help me :S Thanks in advance. -- "winners never quit, quitters never win" ------=_Part_17650_2550911.1144791696845--