I just created a sample application with the exact same code you posted, and the “Goodbye cruel world!” string is only echoed once. Can you post the full code, and tell me which version of Ruby you’re using?
I don’t want to post the full code because it is a little program on which I am working in Ruby 1.8. I have a canvas inside that TkRoot. Could it be that because of the canvas the callback is invoked twice?
It does seem to be because of the canvas, because when I add a canvas to my demo I get the double echo you’re talking about. I can’t find much online documentation for TK so it’s hard to tell why the callback is being called a second time.