From: Hidetoshi NAGAI Date: 2009-05-07T06:22:22+09:00 Subject: Re: Ruby/Tk running very slowly From: Matt Subject: Ruby/Tk running very slowly Date: Sun, 3 May 2009 04:40:04 +0900 Message-ID: > My OS is Windows XP. I'm using Ruby 1.9.1-p0 with ActiveTcl 8.5.7. If you run Ruby (irb) on a command prompt, it may the trouble which depends on "Thread switching". Then, please try ext/tk/sample/irbtkw.rbw. If not on a command prompt, it may trouble on making a thread for a Tcl/Tk interpreter. A Tk eventloop must run on the thread on which a Tcl/Tk interpreter is initialized. To make "Thread.new{Tk.mainloop}" available, Ruby/Tk for ruby1.9.x makes a thread to create a Tcl/Tk interpreter and run a eventloop for the interpreter. Maybe, this process generate the trouble. Could you try to eval the following before "require 'tk'"? ------------------------------------------------------------ module TkCore; RUN_EVENTLOOP_ON_MAIN_THREAD = true; end ------------------------------------------------------------ # Then, "Thread.new{Tk.mainloop}" never work. # A Tk eventloop works on a main thread only. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)