From: Joel VanderWerf Date: 2005-07-08T06:23:59+09:00 Subject: Re: cross-thread violation in TkCanvas when clicked David Brady wrote: > Hi All, > > The Pickaxe (2e) gives an example of drawing on a TkCanvas. The code is > published on the book's website here: > > http://www.pragmaticprogrammer.com/titles/ruby/code/smp262.html > > I run this with no changes. When I click on the canvas, the script > crashes with this message: > > /usr/local/lib/ruby/1.8/tk.rb:1383: [BUG] cross-thread violation on > ip_ruby_cmd() > ruby 1.8.2 (2004-12-25) [i686-linux] > > The offending line is simply the mainloop method: > def mainloop(check_root = true) > TclTkLib.mainloop(check_root) > end > > I find nothing in the errata for the book about this script not working, > so I assume the problem is with my ruby installation or my linux setup. > Any ideas where I can begin looking? > > I am running Ruby 1.8.2 with KDE 3.4 on Kubuntu 5.0.4. Works find for me, also with ruby 1.8.2, KDE3.4, Kubuntu 5.0.4. However, I built Tcl/Tk from scratch with pthread disabled (the default). This was instead of using the ubuntu packages which seem to have pthread enabled. See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/147279