# Ruby/Tk running very slowly

**URL:** <https://www.ruby-forum.com/t/ruby-tk-running-very-slowly/167045>\
**Category:** Ruby\
**Created:** [May 2, 2009, 9:40pm UTC](https://www.ruby-forum.com/t/ruby-tk-running-very-slowly/167045 "2009-05-02T21:40:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [May 2, 2009, 9:40pm UTC](https://www.ruby-forum.com/t/ruby-tk-running-very-slowly/167045/1 "2009-05-02T21:40:29Z")

</div>

Ruby/Tk runs very slowly and I can’t figure out why. It’s so slow  
that I can every little widget being drawn. It didn’t used to be like  
this, but I messed around with my computer and broke something, I  
guess.

My OS is Windows XP. I’m using Ruby 1.9.1-p0 with ActiveTcl 8.5.7.

I compiled Ruby myself and I’ve been experimenting with various  
options to the configure batch file.

This whole problem started with Ruby/Tk hanging. I would try to run a  
Ruby/Tk program and it would hang so badly that I would have to kill  
the process. This hang would happen at the “require ‘tk’” line in the  
program, so no windows were being drawn or anything. I think it broke  
when I was messing around with Tcl/Tk versions 8.4 and 8.5, switching  
between them. It used to work, but I can’t remember which version was  
the working one.

Right now I have both Tk 8.4 and 8.5 installed. I used the --with-  
tclConfig-file configure option to point it at the 8.5 version. I  
think that works, I don’t know.

Any ideas would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [May 5, 2009, 4:29am UTC](https://www.ruby-forum.com/t/ruby-tk-running-very-slowly/167045/2 "2009-05-05T04:29:44Z")

</div>

> My OS is Windows XP. I’m using Ruby 1.9.1-p0 with ActiveTcl 8.5.7.

what compiler? I know I was able to run 1.8.6+tk reasonably well with  
mingw.  
Cheers!  
-=r

---

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [May 6, 2009, 11:26pm UTC](https://www.ruby-forum.com/t/ruby-tk-running-very-slowly/167045/3 "2009-05-06T23:26:53Z")

</div>

From: Matt [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Ruby/Tk running very slowly  
Date: Sun, 3 May 2009 04:40:04 +0900  
Message-ID:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> 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’”?
