On Fri, 2006-11-10 at 02:09 +0900, Aureliano Buendia wrote:
> There is a ruby wrapper available for vtk which works, more or less, 
> fine. For those who are not familiar with vtk, it is avisualisation 
> library written in c++ and the output is a native window showing some 
> interactive OpenGL graphics.
> 
> The VTK code usually ends with:
> 
> iren = Vtk::RenderWindowInteractor.new
> iren.start()
> 
> Here is where the problem comes: iren.start() starts a new thread in 
> c++, while, I am trying to run the script in irb and interactively 
> change the objects properties and see the live results in the OpenGL 
> window. Unfortunately, after iren.start() ruby goes to a deep sleep. 
> This is the irb output:
> 
> >> 
> ?> iren.Start()
> 
> which obviously does not let me to enter any more commands unless I 
> close the window:
> 
> => nil
> >> 
> 
> which is too late for manipulating objects interactively.

I don't have any of this stuff installed, so I'm guessing, but couldn't
you just do e.g.:

winthr = Thread.new { iren.Start() }

// do whatever else you need to do

winthr.kill		# or close the window may be better

Obviously I don't know about the concurrency issues but with this being
interactive I'd guess it's not something you'd worry much about.

-- 
Ross Bamford - rosco / roscopeco.REMOVE.co.uk