From: Hidetoshi NAGAI Date: 2005-10-23T07:46:13+09:00 Subject: Re: Ruby/Tk question From: "Glenn M. Lewis" Subject: Ruby/Tk question Date: Fri, 21 Oct 2005 12:07:00 +0900 Message-ID: > irb(main):004:0> Tk::mainloop > => true You closed the root window here, didn't you?. When the root window is destroyed, the Tk interpreter looses all Tk functions. So, you got the following error. > irb(main):005:0> t = TkRoot.new() { title "yo yo ma" } > RuntimeError: can't invoke "wm" command: application has been destroyed If you want to create widgets again, you have to re-initialize the Tk interpreter. Please try 'Tk.restart'. Although it possibly works, I don't recommned it because I cannot assure you that it can completely reset the interpreter. # If you want to hide the window, 'TkRoot#withdraw' is better. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)