From: nagai@... Date: 2001-12-27T15:02:44+09:00 Subject: [ruby-talk:29461] Re: Tk / IO question Hi, From: "Bob Calco" Subject: [ruby-talk:29440] Tk / IO question Date: Wed, 26 Dec 2001 23:03:14 +0900 Message-ID: > it up. Is there a way to turn the Tk.mainloop off for the duration of the > while loop? I'm sorry but I cannot show you any good solution for your problem. If you want to control running status of Tk.mainloop, you must use one thread for Tk.mainloop. A simple example is -------------------------------- th = TkThread.new{Tk.mainloop} : : th.kill th = TkThread.new{Tk.mainloop} -------------------------------- Another one is -------------------------------- class TkEventLoopSleep < StandardError; end th = Thread.new{ begin Tk.mainloop rescue TkEventLoopSleep sleep retry end } : : th.raise(TkEventLoopSleep) : : th.run -------------------------------- But attention!. Sometimes, they generate other problem that is slowdown of Tk response. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)