From: Jason Tahaney Date: 2006-07-21T03:19:19+09:00 Subject: Re: Best way to kill a thread started from a TkButton push John Johnson wrote: > Jason Tahaney wrote: >> it's argument and simply using thread.kill, and >> setting my button states back to normal ; This for the >> most part works except when I call it from code as >> opposed to from a user event. The button states do >> not go back to normal for some reason when I call >> stop_thread from code. >> >> BTW it's the tk8.3 lib on win32. > > I can't help with your problem exactly, but this sounds like it is to do > with the Binding of the variable(s). > See the Pickaxe book: http://www.rubycentral.com/book/ext_tk.html > > An excerpt: > "One small caution when using the code block form: the scope of > variables is not what you think it is. The block is actually evaluated > in the context of the widget's object, not the caller's. ..." > > Regards, > JJ Thanks, you got me thinking about the scope and it ended up being just that, the scope awareness caution excerpt you provided from the pickaxe book. Regards, Jason -- Posted via http://www.ruby-forum.com/.