From: "Hal E. Fulton" Date: 2002-03-27T04:20:30+09:00 Subject: Re: Error calling Tk in a loop ----- Original Message ----- From: To: "ruby-talk ML" Sent: Tuesday, March 26, 2002 12:46 PM Subject: Error calling Tk in a loop > I'm trying to write some code that pops up a Tk window when for certain > events. > > The first call to display works, but the next one gives this error: > C:/Ruby/lib/ruby/1.6/tk.rb:986:in `_invoke': can't invoke "label" command: > application has been destroyed (RuntimeError) > > The Ruby version is ruby 1.6.6 (2001-12-26) [i586-mswin32] > This is on a Win2K box. I haven't installed any other Tcl/Tk but what came > with the Ruby installation. > I get the same error on my Linux box using Ruby 1.6.7. > > Any ides on what causes this, and how to avoid it? Hmm... I tried adding a Quit button, then using a thread (for mainloop) or a continuation. Neither worked for me. I think I may be on the right track with the button, though... it sometimes seems to me that hitting the X does not terminate the app completely gracefully. Is there a call that will terminate the mainloop? Side note: If you are Windows-only, you might consider using the WIN32OLE trick to throw up a message box. See the Coral Book, chapter 8. Sorry can't help... interesting issue, though. Hal Fulton